File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change 11from __future__ import print_function
22
33import pipes
4- import shutil
54import subprocess
65import sys
76import traceback
@@ -130,15 +129,10 @@ def run(self):
130129 log .info ("Installing Javascript..." )
131130 try :
132131 js_dir = str (package_dir / "client" / "app" )
133- for cmd , * args in map (str .split , ["npm install" , "npm run build" ]):
134- which_cmd = shutil .which (cmd )
135- if which_cmd is None :
136- raise RuntimeError (
137- f"Failed to run command - { cmd !r} is not installed."
138- )
139- cmd_args = [which_cmd ] + args
140- log .info (f"> { list2cmdline (cmd_args )} " )
141- subprocess .check_call (cmd_args , cwd = js_dir )
132+ for args in ("npm install" , "npm run build" ):
133+ args_list = args .split ()
134+ log .info (f"> { list2cmdline (args_list )} " )
135+ subprocess .run (args_list , cwd = js_dir )
142136 except Exception :
143137 log .error ("Failed to install Javascript" )
144138 log .error (traceback .format_exc ())
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ def __init__(
125125
126126 if self .source_type == URL_SOURCE :
127127 if check_exports is True :
128- raise ValueError (f"Cannot check exports of source type { source_type !r} " )
128+ raise ValueError (f"Can't check exports for source type { source_type !r} " )
129129 elif source_file is not None :
130130 raise ValueError (f"File given, but source type is { source_type !r} " )
131131 else :
You can’t perform that action at this time.
0 commit comments