Skip to content

Commit cc5083e

Browse files
authored
[embind] Fix TypeScript generation on windows. (#22233)
Windows can't find `tsc` when using `subprocess.call` when `shell=False` so instead use the full path. Fixes #22181
1 parent 63a9648 commit cc5083e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/emscripten.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,10 @@ def create_tsd_exported_runtime_methods(metadata):
647647
js_doc_file = in_temp('jsdoc.js')
648648
tsc_output_file = in_temp('jsdoc.d.ts')
649649
utils.write_file(js_doc_file, js_doc)
650-
if shutil.which('tsc'):
651-
tsc = ['tsc']
650+
tsc = shutil.which('tsc')
651+
if tsc:
652+
# Use the full path from the which command so windows can find tsc.
653+
tsc = [tsc]
652654
else:
653655
tsc = shared.get_npm_cmd('tsc')
654656
cmd = tsc + ['--outFile', tsc_output_file, '--declaration', '--emitDeclarationOnly', '--allowJs', js_doc_file]

0 commit comments

Comments
 (0)