Files
SonarDesk-Licencing-Server/scripts/export_source.sh
T
2026-10-20 10:22:21 +01:00

37 lines
866 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
# Determine project directory automatically
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
PROJECT_NAME="$(basename "$PROJECT_DIR")"
PARENT_DIR="$(dirname "$PROJECT_DIR")"
OUTPUT="$HOME/Downloads/sonardesk-stylist-source.zip"
echo "Project: $PROJECT_DIR"
echo "Output: $OUTPUT"
mkdir -p "$HOME/Downloads"
# Remove previous archive
rm -f "$OUTPUT"
# Run from parent so the project directory is included
cd "$PARENT_DIR"
zip -r "$OUTPUT" "$PROJECT_NAME" \
-x '*/vendor/*' \
'*/node_modules/*' \
'*/.git/*' \
'*/.env' \
'*/.env.*' \
'*/storage/logs/*' \
'*/storage/framework/cache/*' \
'*/storage/framework/sessions/*' \
'*/storage/framework/views/*'
echo ""
echo "Export completed successfully."
ls -lh "$OUTPUT"