chore: suppress output of npm_action unless it fails (#16888)
This commit is contained in:
parent
6385608f7f
commit
c363eed543
1 changed files with 10 additions and 2 deletions
|
@ -1,10 +1,18 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import os
|
import os
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
|
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
|
||||||
args = ["npm", "run",
|
cmd = "npm"
|
||||||
|
if sys.platform == "win32":
|
||||||
|
cmd += ".cmd"
|
||||||
|
args = [cmd, "run",
|
||||||
"--prefix",
|
"--prefix",
|
||||||
SOURCE_ROOT
|
SOURCE_ROOT
|
||||||
] + sys.argv[1:]
|
] + sys.argv[1:]
|
||||||
os.execvp("npm", args)
|
try:
|
||||||
|
subprocess.check_output(args, stderr=subprocess.STDOUT)
|
||||||
|
except subprocess.CalledProcessError, e:
|
||||||
|
print("NPM script '" + sys.argv[2] + "' failed with code '" + str(e.returncode) + "':\n" + e.output)
|
||||||
|
sys.exit(e.returncode)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue