refactor(nvm): Move wrapper scripts to image_support_files directory
Improved code organization and maintainability: - Created image_support_files/ directory for Docker helper scripts - Moved bash-with-nvm and docker-entrypoint.sh to support directory - Added comprehensive README.md documenting each script's purpose - Updated Dockerfile to COPY from organized directory structure Benefits: - Cleaner repository structure - Scripts are now version-controlled files (not echo chains) - Easier to read, modify, and maintain - Self-documented with in-directory README No functional changes - all nvm functionality remains identical.
This commit is contained in:
14
image_support_files/docker-entrypoint.sh
Normal file
14
image_support_files/docker-entrypoint.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Load nvm in the entrypoint environment
|
||||
export NVM_DIR="/usr/local/nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||
|
||||
# If command is bash -c, inject bashrc sourcing to make nvm available
|
||||
if [ "$1" = "bash" ] && [ "$2" = "-c" ]; then
|
||||
shift 2
|
||||
exec bash -c "source /etc/bash.bashrc && $*"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
Reference in New Issue
Block a user