Refactor deploy-to-opt.sh and fix-npm-cache.sh to set HOME environment variable during npm cache configuration, ensuring correct usage of custom cache directory and improving .npmrc management.
This commit is contained in:
@@ -79,7 +79,7 @@ chown -R $USER:$GROUP "$NPM_CACHE_DIR"
|
||||
# Installiere Dependencies
|
||||
echo ""
|
||||
echo "Installiere Dependencies..."
|
||||
sudo -u $USER bash -c "cd '$TARGET_DIR' && npm config set cache '$NPM_CACHE_DIR' && npm run install:all"
|
||||
sudo -u $USER bash -c "cd '$TARGET_DIR' && HOME='$TARGET_DIR' npm config set cache '$NPM_CACHE_DIR' && HOME='$TARGET_DIR' npm run install:all"
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "FEHLER: Installation der Dependencies fehlgeschlagen!"
|
||||
@@ -91,7 +91,7 @@ echo "✓ Dependencies installiert"
|
||||
# Baue Client
|
||||
echo ""
|
||||
echo "Baue Client für Production..."
|
||||
sudo -u $USER bash -c "cd '$TARGET_DIR' && npm config set cache '$NPM_CACHE_DIR' && cd client && npm config set cache '$NPM_CACHE_DIR' && cd .. && npm run build"
|
||||
sudo -u $USER bash -c "cd '$TARGET_DIR' && HOME='$TARGET_DIR' npm config set cache '$NPM_CACHE_DIR' && cd client && HOME='$TARGET_DIR' npm config set cache '$NPM_CACHE_DIR' && cd .. && HOME='$TARGET_DIR' npm run build"
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "FEHLER: Build fehlgeschlagen!"
|
||||
|
||||
Reference in New Issue
Block a user