2018-05-03 22:44:29 +00:00
|
|
|
#!/usr/bin/env python
|
2019-06-15 17:26:09 +00:00
|
|
|
from __future__ import print_function
|
2018-05-03 22:44:29 +00:00
|
|
|
import os
|
2019-02-13 05:32:47 +00:00
|
|
|
import subprocess
|
2018-05-03 22:44:29 +00:00
|
|
|
import sys
|
|
|
|
|
|
|
|
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
|
2019-02-13 05:32:47 +00:00
|
|
|
cmd = "npm"
|
|
|
|
if sys.platform == "win32":
|
|
|
|
cmd += ".cmd"
|
|
|
|
args = [cmd, "run",
|
2018-05-03 22:44:29 +00:00
|
|
|
"--prefix",
|
|
|
|
SOURCE_ROOT
|
|
|
|
] + sys.argv[1:]
|
2019-02-13 05:32:47 +00:00
|
|
|
try:
|
|
|
|
subprocess.check_output(args, stderr=subprocess.STDOUT)
|
2019-06-15 17:26:09 +00:00
|
|
|
except subprocess.CalledProcessError as e:
|
2019-02-13 05:32:47 +00:00
|
|
|
print("NPM script '" + sys.argv[2] + "' failed with code '" + str(e.returncode) + "':\n" + e.output)
|
|
|
|
sys.exit(e.returncode)
|