mirror of
https://github.com/ivabus/pantry
synced 2024-11-10 10:35:17 +03:00
45 lines
949 B
YAML
45 lines
949 B
YAML
distributable:
|
||
url: https://github.com/npm/cli/archive/refs/tags/v{{ version }}.tar.gz
|
||
strip-components: 1
|
||
|
||
versions:
|
||
github: npm/cli/tags
|
||
|
||
provides:
|
||
- bin/npm
|
||
- bin/npx
|
||
|
||
dependencies:
|
||
nodejs.org: '>=14'
|
||
|
||
build:
|
||
dependencies:
|
||
crates.io/semverator: '*'
|
||
script:
|
||
- |
|
||
if semverator satisfies '^8,>=9.4.2' {{ version }}; then
|
||
ARGS="--install-links"
|
||
fi
|
||
|
||
- node . install --global --prefix={{prefix}} $ARGS
|
||
|
||
# configures npm to install to ~/.local
|
||
- mv props/npmrc {{prefix}}/lib/node_modules/npm
|
||
|
||
# our shim fixes a bug where npx doesn’t work if ~/.local/lib doesn’t exist
|
||
- run: |
|
||
rm npx
|
||
mv $SRCROOT/props/npx-shim npx
|
||
working-directory:
|
||
${{prefix}}/bin
|
||
|
||
test:
|
||
# doing first to test our shim works as expected
|
||
- npx -qy tldr ls
|
||
|
||
- npm install --global cowsay
|
||
|
||
# verify install location is as we configure it
|
||
- $HOME/.local/bin/cowsay xyz.tea.hi
|
||
|