mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-21 02:24:29 -04:00
Merge pull request #513 from linuxserver/code-server-npmglobal-fulls6v3
support full s6v3 images
This commit is contained in:
@@ -4,15 +4,28 @@
|
|||||||
if [ -f /usr/bin/npm ]; then
|
if [ -f /usr/bin/npm ]; then
|
||||||
echo "creating npm global folder in /config"
|
echo "creating npm global folder in /config"
|
||||||
mkdir -p /config/npm-global
|
mkdir -p /config/npm-global
|
||||||
|
chown abc:abc /config/npm-global
|
||||||
|
|
||||||
echo "setting npm to global folder in /config"
|
echo "setting npm to global folder in /config"
|
||||||
npm config set prefix '/config/npm-global'
|
s6-setuidgid abc npm config set prefix '/config/npm-global'
|
||||||
|
|
||||||
if grep -q "/config/npm-global/bin" "/etc/services.d/code-server/run"; then
|
if grep -q "/config/npm-global/bin" "/etc/services.d/code-server/run" 2>/dev/null || \
|
||||||
|
grep -q "/config/npm-global/bin" "/etc/services.d/openvscode-server/run" 2>/dev/null || \
|
||||||
|
grep -q "/config/npm-global/bin" "/etc/s6-overlay/s6-rc.d/svc-code-server/run" 2>/dev/null || \
|
||||||
|
grep -q "/config/npm-global/bin" "/etc/s6-overlay/s6-rc.d/svc-openvscode-server/run" 2>/dev/null; then
|
||||||
echo "npm-global already in PATH"
|
echo "npm-global already in PATH"
|
||||||
else
|
elif [ -f "/etc/services.d/code-server/run" ]; then
|
||||||
echo "ensuring npm-global is in PATH"
|
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
|
sed -i '/^#!\/usr\/bin/a \\n# Added by codeserver-npmglobal\nexport PATH=/config/npm-global/bin:$PATH' /etc/services.d/code-server/run
|
||||||
|
elif [ -f "/etc/services.d/openvscode-server/run" ]; then
|
||||||
|
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/openvscode-server/run
|
||||||
|
elif [ -f "/etc/s6-overlay/s6-rc.d/svc-code-server/run" ]; then
|
||||||
|
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/s6-overlay/s6-rc.d/svc-code-server/run
|
||||||
|
elif [ -f "/etc/s6-overlay/s6-rc.d/svc-openvscode-server/run" ]; then
|
||||||
|
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/s6-overlay/s6-rc.d/svc-openvscode-server/run
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "**** npm not installed, skipping npmglobal install ****"
|
echo "**** npm not installed, skipping npmglobal install ****"
|
||||||
|
|||||||
Reference in New Issue
Block a user