Skip to content

Commit 91ac82d

Browse files
author
Tien Nguyen
committed
Modify subprocess command for MacOS.
1 parent b42e755 commit 91ac82d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,14 @@ def _is_executable(path):
145145
return os.path.isfile(path) and os.access(path, os.X_OK)
146146

147147
def _get_npm_tsc_version():
148-
if os.name != 'nt' and _is_executable("/usr/local/bin/tsc"):
149-
cmd = ["/usr/local/bin/tsc", "-v"]
148+
if os.name != 'nt' and _is_executable("/usr/local/bin/tsc"): # Default location on MacOS
149+
cmd = [get_node_path(), "/usr/local/bin/tsc", "-v"]
150150
else:
151151
cmd = ["tsc", "-v"]
152152
return _execute_cmd_and_parse_version_from_output(cmd)
153153

154154
def _execute_cmd_and_parse_version_from_output(cmd):
155-
if os.name != 'nt':
155+
if os.name != 'nt': # Linux/MacOS
156156
cmd = "'" + "' '".join(cmd) + "'"
157157
output = subprocess.check_output(cmd, shell=True).decode('UTF-8')
158158

0 commit comments

Comments
 (0)