bashrc.before anche con npm

master
Guido Longoni 2022-11-17 17:20:16 +01:00
parent 49abf3834a
commit 6100e7702b
1 changed files with 4 additions and 4 deletions

View File

@ -17,12 +17,12 @@ function feat_addpacks_npm_dev() {
function feat_add_npm() {
feat_addpacks_npm_dev
cat - "$HOME/.bashrc" <<- EOF > "$HOME/.bashrc.tmp"
export N_PREFIX="\$HOME/.n_prefix"
cat - "$HOME/.bashrc.before" <<- EOF > "$HOME/.bashrc.before.tmp"
export N_PREFIX="\$HOME/.local"
export PATH="\$N_PREFIX/bin:\$PATH"
EOF
mv "$HOME/.bashrc.tmp" "$HOME/.bashrc"
. "$HOME/.bashrc"
mv "$HOME/.bashrc.before.tmp" "$HOME/.bashrc.before"
. "$HOME/.bashrc.before"
mkdir -p "$N_PREFIX"
curl -L https://raw.githubusercontent.com/tj/n/master/bin/n | bash -s latest
npm install -g n