fix permissions on web

This commit is contained in:
Peter Steinberger 2025-06-16 08:10:43 +02:00
parent 8b8d4fb4c3
commit 08837015c7
2 changed files with 1 additions and 1 deletions

View file

@ -313,7 +313,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/zsh;
shellScript = "# Build web frontend\necho \"Building web frontend...\"\n\n[ -f \"$HOME/.profile\" ] && . \"$HOME/.profile\"\n[ -f \"$HOME/.zprofile\" ] && . \"$HOME/.zprofile\"\n\n# Get the project directory\nPROJECT_DIR=\"${SRCROOT}\"\nWEB_DIR=\"${PROJECT_DIR}/web\"\nPUBLIC_DIR=\"${WEB_DIR}/public\"\nDEST_DIR=\"${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Resources/web/public\"\n\n# Export CI environment variable to prevent interactive prompts\nexport CI=true\n\n# Check if npm is available\nif ! command -v npm &> /dev/null; then\n echo \"error: npm could not be found in PATH\"\n echo \"PATH is: $PATH\"\n echo \"Please ensure Node.js is installed and available in your shell configuration\"\n exit 1\nfi\n\n# Print npm version for debugging\necho \"Using npm version: $(npm --version)\"\necho \"Using node version: $(node --version)\"\necho \"PATH: $PATH\"\n\n# Check if web directory exists\nif [ ! -d \"${WEB_DIR}\" ]; then\n echo \"error: Web directory not found at ${WEB_DIR}\"\n exit 1\nfi\n\n# Change to web directory\ncd \"${WEB_DIR}\"\n\n# Install dependencies\necho \"Installing npm dependencies...\"\nnpm install --no-progress --no-audit\nif [ $? -ne 0 ]; then\n echo \"error: npm install failed\"\n exit 1\nfi\n\n# Build the web frontend\necho \"Running npm build...\"\nnpm run build\nif [ $? -ne 0 ]; then\n echo \"error: npm run build failed\"\n exit 1\nfi\n\n# Create destination directory\nmkdir -p \"${DEST_DIR}\"\n\n# Copy built files to Resources\necho \"Copying web files to app bundle...\"\nif [ -d \"${PUBLIC_DIR}\" ]; then\n # Copy all files from public directory\n cp -R \"${PUBLIC_DIR}/\"* \"${DEST_DIR}/\"\n echo \"Web frontend files copied to ${DEST_DIR}\"\nelse\n echo \"error: Public directory not found at ${PUBLIC_DIR}\"\n exit 1\nfi\n";
shellScript = "# Build web frontend\necho \"Building web frontend...\"\n\n[ -f \"$HOME/.profile\" ] && . \"$HOME/.profile\"\n[ -f \"$HOME/.zprofile\" ] && . \"$HOME/.zprofile\"\n\n# Get the project directory\nPROJECT_DIR=\"${SRCROOT}\"\nWEB_DIR=\"${PROJECT_DIR}/web\"\nPUBLIC_DIR=\"${WEB_DIR}/public\"\nDEST_DIR=\"${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Resources/web/public\"\n\n# Export CI environment variable to prevent interactive prompts\nexport CI=true\n\n# Check if npm is available\nif ! command -v npm &> /dev/null; then\n echo \"error: npm could not be found in PATH\"\n echo \"PATH is: $PATH\"\n echo \"Please ensure Node.js is installed and available in your shell configuration\"\n exit 1\nfi\n\n# Print npm version for debugging\necho \"Using npm version: $(npm --version)\"\necho \"Using node version: $(node --version)\"\necho \"PATH: $PATH\"\n\n# Check if web directory exists\nif [ ! -d \"${WEB_DIR}\" ]; then\n echo \"error: Web directory not found at ${WEB_DIR}\"\n exit 1\nfi\n\n# Change to web directory\ncd \"${WEB_DIR}\"\n\n# Install dependencies\necho \"Installing npm dependencies...\"\nnpm install --no-progress --no-audit\nif [ $? -ne 0 ]; then\n echo \"error: npm install failed\"\n exit 1\nfi\n\n# Fix permissions for tailwindcss executable\nif [ -f \"node_modules/.bin/tailwindcss\" ]; then\n chmod +x \"node_modules/.bin/tailwindcss\"\nfi\nif [ -f \"node_modules/tailwindcss/lib/cli.js\" ]; then\n chmod +x \"node_modules/tailwindcss/lib/cli.js\"\nfi\n\n# Clean up any existing output.css directory/file conflicts\nif [ -d \"public/output.css\" ]; then\n rm -rf \"public/output.css\"\nfi\n\n# Build the web frontend\necho \"Running npm build...\"\nnpm run build\nif [ $? -ne 0 ]; then\n echo \"error: npm run build failed\"\n exit 1\nfi\n\n# Create destination directory\nmkdir -p \"${DEST_DIR}\"\n\n# Copy built files to Resources\necho \"Copying web files to app bundle...\"\nif [ -d \"${PUBLIC_DIR}\" ]; then\n # Copy all files from public directory\n cp -R \"${PUBLIC_DIR}/\"* \"${DEST_DIR}/\"\n echo \"Web frontend files copied to ${DEST_DIR}\"\nelse\n echo \"error: Public directory not found at ${PUBLIC_DIR}\"\n exit 1\nfi\n";
};
/* End PBXShellScriptBuildPhase section */