-
Notifications
You must be signed in to change notification settings - Fork 15k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: fail a build if some hooks don't succeed (#16369)
- Loading branch information
1 parent
fd8b945
commit 0a5adfe
Showing
2 changed files
with
22 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import subprocess | ||
import sys | ||
|
||
|
||
def npm(*npm_args): | ||
call_args = [__get_executable_name()] + list(npm_args) | ||
subprocess.check_call(call_args) | ||
|
||
|
||
def __get_executable_name(): | ||
executable = 'npm' | ||
if sys.platform == 'win32': | ||
executable += '.cmd' | ||
return executable | ||
|
||
|
||
if __name__ == '__main__': | ||
npm(*sys.argv[1:]) |