Call npm from client dir

pull/15/head
JamesRamm 2017-02-10 18:43:22 +00:00
rodzic 48194bb63b
commit 6ef470b01d
2 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -1,4 +1,5 @@
-r requirements.txt
bumpversion==0.5.3
wheel==0.29.0
setuptools

Wyświetl plik

@ -17,7 +17,12 @@ class sdist(base_sdist):
Compile the front end assets
'''
try:
subprocess.check_call(['npm', '--prefix', 'longclaw/client/', 'run', 'build'])
# Move into client dir
curdir = os.path.abspath(os.curdir)
client_path = os.path.join(os.path.dirname(__file__), 'longclaw', 'client')
os.chdir(client_path)
subprocess.check_call(['npm', 'run', 'build'])
os.chdir(curdir)
except (OSError, subprocess.CalledProcessError) as err:
print('Error compiling assets: {}'.format(err))
raise SystemExit(1)