mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Merge pull request #17232 from github/redsun82/kotlin
Kotlin: fix wrapper on windows and use `os.execv` on POSIX
This commit is contained in:
@@ -122,10 +122,13 @@ def forward(tool, forwarded_opts):
|
||||
if platform.system() == "Windows":
|
||||
tool = tool.with_suffix(".bat")
|
||||
assert tool.exists(), f"{tool} not found"
|
||||
args = [tool]
|
||||
args.extend(forwarded_opts)
|
||||
ret = subprocess.run(args).returncode
|
||||
cmd = [tool] + forwarded_opts
|
||||
if platform.system() == "Windows":
|
||||
# kotlin bat script is pretty sensible to unquoted args on windows
|
||||
ret = subprocess.run(" ".join(f'"{a}"' for a in cmd)).returncode
|
||||
sys.exit(ret)
|
||||
else:
|
||||
os.execv(cmd[0], cmd)
|
||||
|
||||
|
||||
def clear():
|
||||
|
||||
Reference in New Issue
Block a user