mirror of
https://github.com/ivabus/pantry
synced 2024-11-23 00:45:07 +03:00
proper npx fix
This commit is contained in:
parent
baf044ad07
commit
d5cf4aef4c
2 changed files with 14 additions and 10 deletions
|
@ -4,7 +4,7 @@
|
||||||
# FIXME a patch to npm here then upstream would be preferable
|
# FIXME a patch to npm here then upstream would be preferable
|
||||||
mkdir -p ~/.local/lib
|
mkdir -p ~/.local/lib
|
||||||
|
|
||||||
d="$(cd "$(dirname $0)"/.. && pwd)"
|
d="$(cd "$(dirname $0)" && pwd)"
|
||||||
"$d"/tbin/npx "$@"
|
"$d"/npm exec "$@"
|
||||||
|
|
||||||
# ※ https://github.com/teaxyz/cli/issues/532
|
# ※ https://github.com/teaxyz/cli/issues/532
|
|
@ -26,15 +26,19 @@ build:
|
||||||
# configures npm to install to ~/.local
|
# configures npm to install to ~/.local
|
||||||
- mv props/npmrc {{prefix}}/lib/node_modules/npm
|
- mv props/npmrc {{prefix}}/lib/node_modules/npm
|
||||||
|
|
||||||
# our shim fixes a bug where npm doesn’t work if ~/.local/lib doesn’t exist
|
# our shim fixes a bug where npx doesn’t work if ~/.local/lib doesn’t exist
|
||||||
- run: |
|
- run: |
|
||||||
mv ../bin/npm .
|
rm npx
|
||||||
mv $SRCROOT/props/npm-shim ../bin/npm
|
mv $SRCROOT/props/npx-shim npx
|
||||||
working-directory:
|
working-directory:
|
||||||
${{prefix}}/tbin
|
${{prefix}}/bin
|
||||||
|
|
||||||
test: |
|
test:
|
||||||
npm install --global cowsay
|
# doing first to test our shim works as expected
|
||||||
$HOME/.local/bin/cowsay xyz.tea.hi
|
- npx -qy tldr ls
|
||||||
|
|
||||||
|
- npm install --global cowsay
|
||||||
|
|
||||||
|
# verify install location is as we configure it
|
||||||
|
- $HOME/.local/bin/cowsay xyz.tea.hi
|
||||||
|
|
||||||
npx -qy tldr ls
|
|
||||||
|
|
Loading…
Reference in a new issue