fix(cli): resolve git-bash for the lab entry point on windows
This commit is contained in:
+4
-2
@@ -2,6 +2,7 @@ import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
@@ -246,8 +247,9 @@ def cmd_exploit(args):
|
||||
|
||||
|
||||
def cmd_lab(args):
|
||||
up = os.path.join(ROOT, "lab", "up.sh")
|
||||
r = subprocess.run(["bash", up])
|
||||
up = os.path.join(ROOT, "lab", "up.sh").replace("\\", "/")
|
||||
shell = shutil.which("bash") or "/bin/bash"
|
||||
r = subprocess.run([shell, up])
|
||||
if r.returncode != 0:
|
||||
print("lab up failed", file=sys.stderr)
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user