Skip to content

Commit a899eb9

Browse files
committed
fix(ubuntu-node-dev.sh): missing pnpm and profile.d setups
1 parent b309f11 commit a899eb9

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

ubuntu/ubuntu-node-dev.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,24 @@ export SHELL=/bin/zsh
3535
wget https://fnm.vercel.app/install -O- | sh
3636
source ~/.zshrc
3737
fnm install --lts
38+
39+
# Setup the environment path for pnpm
40+
touch /etc/profile.d/pnpmPath.sh && \
41+
echo 'export PNPM_HOME=/root/.local/share/pnpm' >> /etc/profile.d/pnpmPath.sh && \
42+
echo 'export PATH=$PNPM_HOME:$PATH' >> /etc/profile.d/pnpmPath.sh && \
43+
source /etc/profile.d/pnpmPath.sh
44+
45+
# Install pnpm and ni
46+
npm install --global corepack@latest
47+
corepack enable
48+
corepack prepare pnpm --activate
49+
pnpm i -g @antfu/ni && \
50+
touch ~/.nirc && \
51+
echo 'defaultAgent=pnpm' >> ~/.nirc && \
52+
echo 'globalAgent=pnpm' >> ~/.nirc
53+
54+
# Adding a simple command to change git remote connection from/to ssh/https
55+
touch /etc/profile.d/gitRemoteChanger.sh && \
56+
echo alias git-ssh=\'git remote set-url origin \"\$\(git remote get-url origin \| sed -E \'\\\'\'s,\^https://\(\[\^/\]\*\)/\(.\*\)\$,git@\\1:\\2,\'\\\'\'\)\"\' >> /etc/profile.d/gitRemoteChanger.sh && \
57+
echo alias git-https=\'git remote set-url origin \"\$\(git remote get-url origin \| sed -E \'\\\'\'s,\^git@\(\[\^:\]\*\):/\*\(.\*\)\$,https://\\1/\\2,\'\\\'\'\)\"\' >> /etc/profile.d/gitRemoteChanger.sh && \
58+
source /etc/profile.d/gitRemoteChanger.sh

0 commit comments

Comments
 (0)