Skip to content

Commit beba032

Browse files
author
Paolo Tranquilli
committed
Kotlin: fix wrapper on windows
1 parent b16dc20 commit beba032

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

java/kotlin-extractor/dev/wrapper.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,13 @@ def forward(tool, forwarded_opts):
122122
if platform.system() == "Windows":
123123
tool = tool.with_suffix(".bat")
124124
assert tool.exists(), f"{tool} not found"
125-
args = [tool]
126-
args.extend(forwarded_opts)
127-
ret = subprocess.run(args).returncode
128-
sys.exit(ret)
125+
cmd = [tool] + forwarded_opts
126+
if platform.system() == "Windows":
127+
# kotlin bat script is pretty sensible to unquoted args on windows
128+
ret = subprocess.run(" ".join(f'"{a}"' for a in cmd)).returncode
129+
sys.exit(ret)
130+
else:
131+
os.execv(cmd[0], cmd)
129132

130133

131134
def clear():

0 commit comments

Comments
 (0)