From e8ffea2c58669346885148c2ea444777492934e1 Mon Sep 17 00:00:00 2001 From: dyzulk <66510723+dyzulk@users.noreply.github.com> Date: Sat, 17 Jan 2026 13:49:58 +0700 Subject: [PATCH] fix: Set HOME environment variable at script start and add explicit permissions for node_modules and the tailwindcss binary. --- aapanel_deploy.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/aapanel_deploy.sh b/aapanel_deploy.sh index 31c4841..1614be5 100644 --- a/aapanel_deploy.sh +++ b/aapanel_deploy.sh @@ -4,6 +4,9 @@ PROJECT_PATH="/www/wwwroot/" +# Set HOME at the beginning - essential for git and npm +export HOME="$PROJECT_PATH" + echo "---------------------------------------" echo "Starting Deployment: $(date)" echo "---------------------------------------" @@ -17,7 +20,7 @@ cd $PROJECT_PATH || exit # 1. Pull latest changes echo "Step 1: Pulling latest changes from Git..." -# Fix for dubious ownership error +# Fix for dubious ownership error - now works because HOME is set git config --global --add safe.directory $PROJECT_PATH git pull origin main @@ -32,12 +35,19 @@ fi # 3. Build Assets if [ -f "package.json" ]; then echo "Step 3: Building assets..." - # Set HOME for npm/node environment - export HOME="$PROJECT_PATH" # If node_modules doesn't exist, install first if [ ! -d "node_modules" ]; then + echo "node_modules not found, installing..." npm install fi + + # Force permissions on the tailwind binary and its target + echo "Ensuring node_modules permissions..." + chmod -R 755 node_modules + find node_modules/.bin/ -type l -exec chmod -h 755 {} + + find node_modules/tailwindcss/ -type f -name "tailwindcss" -exec chmod +x {} + + + # Try running build npm run build fi