Update 98-npmglobal

fixed npm-global always being added
This commit is contained in:
Simon Smith 2020-11-22 15:54:39 +00:00 committed by GitHub
parent dfab3bc3f6
commit 1850d6f893
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,11 @@ if [ -f /usr/bin/npm ]; then
echo "setting npm to global folder in /config"
npm config set prefix '/config/npm-global'
echo "ensuring npm-global is in PATH"
sed -i '/^#!\/usr\/bin/a \\n# Added by codeserver-npmglobal\nexport PATH=/config/npm-global/bin:$PATH' /etc/services.d/code-server/run
if grep -q "/config/npm-global/bin" "/etc/services.d/code-server/run"; then
echo "npm-global already in PATH"
else
echo "ensuring npm-global is in PATH"
sed -i '/^#!\/usr\/bin/a \\n# Added by codeserver-npmglobal\nexport PATH=/config/npm-global/bin:$PATH' /etc/services.d/code-server/run
fi
fi