Files
docker-mods-uptime-kuma-tim…/root/etc/cont-init.d/98-npmglobal
T
Simon Smith 1850d6f893 Update 98-npmglobal
fixed npm-global always being added
2020-11-22 15:54:39 +00:00

19 lines
566 B
Plaintext

#!/usr/bin/with-contenv bash
# check npm exists
if [ -f /usr/bin/npm ]; then
echo "creating npm global folder in /config"
mkdir -p /config/npm-global
echo "setting npm to global folder in /config"
npm config set prefix '/config/npm-global'
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