Skip to content

Commit a544274

Browse files
committed
add more logs to JS install
1 parent aeff52c commit a544274

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

setup.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import pipes
66
import shutil
77
import subprocess
8+
import traceback
89

910
from setuptools import setup, find_packages
1011
from distutils import log
@@ -122,10 +123,19 @@ def list2cmdline(cmd_list):
122123
def build_javascript_first(cls):
123124
class Command(cls):
124125
def run(self):
125-
for cmd, *args in map(str.split, ["npm install", "npm run build"]):
126-
cmd_args = [shutil.which(cmd)] + args
127-
log.info(list2cmdline(cmd_args))
128-
subprocess.check_call(cmd_args, cwd=os.path.join(root, "client", "app"))
126+
log.info("Installing Javascript...")
127+
try:
128+
js_dir = os.path.join(root, "client", "app")
129+
for cmd, *args in map(str.split, ["npm install", "npm run build"]):
130+
cmd_args = [shutil.which(cmd)] + args
131+
log.info(f"> {list2cmdline(cmd_args)}")
132+
subprocess.check_call(cmd_args, cwd=js_dir)
133+
except Exception:
134+
log.error("Failed to install Javascript")
135+
log.error(traceback.format_exc())
136+
raise
137+
else:
138+
log.info("Successfully installed Javascript")
129139
super().run()
130140

131141
return Command

0 commit comments

Comments
 (0)