mirror of
https://github.com/ivabus/pantry
synced 2024-11-10 02:25:18 +03:00
github.com/nvm-sh/nvm (#3681)
* new file: projects/github.com/nvm-sh/nvm/package.yml * wip * dir... * sure... curl on linux
This commit is contained in:
parent
9fe4eab04d
commit
217aa7f764
25
projects/github.com/nvm-sh/nvm/README.md
Normal file
25
projects/github.com/nvm-sh/nvm/README.md
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
### Configuring NVM on Linux and Darwin
|
||||||
|
|
||||||
|
#### For Linux
|
||||||
|
|
||||||
|
Insert the following lines into your `~/.profile` file:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[ -s "$NVM_DIR/libexec/nvm.sh" ] && \. "$NVM_DIR/libexec/nvm.sh" # Loads nvm
|
||||||
|
[ -s "$NVM_DIR/etc/bash_completion.d/nvm" ] && \. "$NVM_DIR/etc/bash_completion.d/nvm" # Loads nvm bash_completion
|
||||||
|
```
|
||||||
|
|
||||||
|
Execute `source ~/.profile` to apply the changes or simply restart your terminal.
|
||||||
|
|
||||||
|
#### For Darwin (macOS)
|
||||||
|
|
||||||
|
Insert the following lines into your `~/.zshrc` file:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[ -s "$NVM_DIR/libexec/nvm.sh" ] && \. "$NVM_DIR/libexec/nvm.sh" # Loads nvm
|
||||||
|
[ -s "$NVM_DIR/etc/bash_completion.d/nvm" ] && \. "$NVM_DIR/etc/bash_completion.d/nvm" # Loads nvm bash_completion
|
||||||
|
```
|
||||||
|
|
||||||
|
Execute `source ~/.zshrc` to apply the changes or simply restart your terminal.
|
||||||
|
|
||||||
|
Now you can use nvm in your terminal to manage Node.js versions.
|
48
projects/github.com/nvm-sh/nvm/package.yml
Normal file
48
projects/github.com/nvm-sh/nvm/package.yml
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
distributable:
|
||||||
|
url: https://github.com/nvm-sh/nvm/archive/v{{version}}.tar.gz
|
||||||
|
strip-components: 1
|
||||||
|
versions:
|
||||||
|
github: nvm-sh/nvm
|
||||||
|
warnings:
|
||||||
|
- vendored
|
||||||
|
runtime:
|
||||||
|
env:
|
||||||
|
NVM_DIR: "{{prefix}}"
|
||||||
|
dependencies:
|
||||||
|
linux:
|
||||||
|
curl.se: '*'
|
||||||
|
build:
|
||||||
|
script:
|
||||||
|
- run: mkdir -p bin libexec etc/bash_completion.d
|
||||||
|
working-directory: "{{prefix}}"
|
||||||
|
- install nvm.sh nvm-exec {{prefix}}/libexec/
|
||||||
|
- install bash_completion {{prefix}}/etc/bash_completion.d/nvm
|
||||||
|
- run: |
|
||||||
|
ln -s ../libexec/nvm-exec || true
|
||||||
|
working-directory: "{{prefix}}/bin"
|
||||||
|
- run: |
|
||||||
|
sed -i.bak "s|unset NVM_CD_FLAGS|unset NVM_CD_FLAGS \&\& DIR=\$DIR/../libexec|g" nvm-exec
|
||||||
|
rm *.bak
|
||||||
|
working-directory: "{{prefix}}/libexec"
|
||||||
|
provides:
|
||||||
|
- bin/nvm-exec
|
||||||
|
test:
|
||||||
|
script:
|
||||||
|
- NODE_VERSION=pkgx nvm-exec || echo $? | grep 127
|
||||||
|
- run: |
|
||||||
|
cat << EOF > .zshrc
|
||||||
|
[ -s "\$NVM_DIR/libexec/nvm.sh" ] && \. "\$NVM_DIR/libexec/nvm.sh" # This loads nvm
|
||||||
|
[ -s "\$NVM_DIR/etc/bash_completion.d/nvm" ] && \. "\$NVM_DIR/etc/bash_completion.d/nvm" # This loads nvm bash_completion
|
||||||
|
EOF
|
||||||
|
source ./.zshrc
|
||||||
|
if: darwin
|
||||||
|
- run: |
|
||||||
|
cat << EOF > .profile
|
||||||
|
[ -s "\$NVM_DIR/libexec/nvm.sh" ] && \. "\$NVM_DIR/libexec/nvm.sh" # This loads nvm
|
||||||
|
[ -s "\$NVM_DIR/etc/bash_completion.d/nvm" ] && \. "\$NVM_DIR/etc/bash_completion.d/nvm" # This loads nvm bash_completion
|
||||||
|
EOF
|
||||||
|
source ./.profile
|
||||||
|
if: linux
|
||||||
|
- nvm install v12.14.1
|
||||||
|
- node -v | grep 12.14.1
|
||||||
|
|
Loading…
Reference in a new issue