electron/build/npm-run.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 строка
527 B
Python
Исходник Обычный вид История

#!/usr/bin/env python3
2018-05-04 01:44:29 +03:00
import os
import subprocess
2018-05-04 01:44:29 +03:00
import sys
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
cmd = "npm"
if sys.platform == "win32":
cmd += ".cmd"
args = [cmd, "run",
2018-05-04 01:44:29 +03:00
"--prefix",
SOURCE_ROOT
] + sys.argv[1:]
try:
subprocess.check_output(args, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
error_msg = "NPM script '{}' failed with code '{}':\n".format(sys.argv[2], e.returncode)
print(error_msg + e.output.decode('utf8'))
sys.exit(e.returncode)