mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 00:24:47 +04:00
Support lifecycle scripts for node
The `npm pack` runs lifecycle scripts which can spoil the standard output of the command and prevent correct parsing of the created tarball. For details see: https://docs.npmjs.com/cli/v8/using-npm/scripts#life-cycle-scripts Include a simple fix to parse out the tarball from the last line and cover the fix with a simple test. Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
This commit is contained in:
parent
0252908c27
commit
1cee8274a5
2 changed files with 17 additions and 3 deletions
|
|
@ -99,7 +99,7 @@ def install_environment(
|
|||
lang_base.setup_cmd(prefix, local_install_cmd)
|
||||
|
||||
_, pkg, _ = cmd_output('npm', 'pack', cwd=prefix.prefix_dir)
|
||||
pkg = prefix.path(pkg.strip())
|
||||
pkg = prefix.path(pkg.strip().split()[-1])
|
||||
|
||||
install = ('npm', 'install', '-g', pkg, *additional_dependencies)
|
||||
lang_base.setup_cmd(prefix, install)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue