Update structure and release script

This commit is contained in:
Roman Jaroš 2024-08-07 11:26:42 +02:00
parent c38735528c
commit 13d41bfd1b
35 changed files with 142 additions and 110 deletions

View file

@ -14,28 +14,39 @@ fi
# Define the name of the zipfile
ZIPFILE="czech-quests-v$VERSION.zip"
# Define files/directories to zip
FILES_TO_ZIP="*"
# Define the output directory
OUT_DIR="CzechQuests"
# Define files/directories to exclude
# Create the output directory
mkdir -p $OUT_DIR
# Define files/directories to copy
FILES_TO_COPY="*"
# Define files/directories to exclude while copying
# File names should be separated by space and wrapped in double quotes
EXCLUDE_FILES=(
".git"
".idea"
".gitignore"
".gitattributes"
"screenshot.png"
"README.md"
"release.sh"
ZIPFILE
$OUT_DIR
)
# Initialize exclusion string
EXCLUDE=""
# Build exclusion string
for FILE in "${EXCLUDE_FILES[@]}"; do
EXCLUDE+=" --exclude=$FILE"
# Copy files to the output directory
for FILE in $FILES_TO_COPY
do
echo "Processing $FILE file..."
if [[ ! " ${EXCLUDE_FILES[@]} " =~ " ${FILE} " ]]; then
cp -r $FILE $OUT_DIR
echo "Copied $FILE"
fi
done
# Create the zip file
eval "zip -r $ZIPFILE $FILES_TO_ZIP$EXCLUDE"
# Create the zip file at parent level, including the 'dist' directory
zip -r $ZIPFILE $OUT_DIR
# Optionally, remove the copied unzipped files in 'dist'
rm -rf $OUT_DIR