Kotlin: fix wrapper on windows

This commit is contained in:
Paolo Tranquilli
2024-08-15 10:31:32 +02:00
parent b16dc20bbd
commit beba032ba5

View File

@@ -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
sys.exit(ret)
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():