addon/release.sh

41 lines
834 B
Bash

#!/bin/bash
# Define the file
TOC_FILE="CzechQuests.toc"
if [[ -f "$TOC_FILE" ]]; then
# Read version number from the file
VERSION=$(grep "## Version:" "$TOC_FILE" | cut -d ' ' -f 3)
echo "Version: $VERSION"
else
echo "File $TOC_FILE does not exist."
fi
# Define the name of the zipfile
ZIPFILE="czech-quests-v$VERSION.zip"
# Define files/directories to zip
FILES_TO_ZIP="*"
# Define files/directories to exclude
# File names should be separated by space and wrapped in double quotes
EXCLUDE_FILES=(
".idea"
".gitignore"
".gitattributes"
"screenshot.png"
"README.md"
"release.sh"
ZIPFILE
)
# Initialize exclusion string
EXCLUDE=""
# Build exclusion string
for FILE in "${EXCLUDE_FILES[@]}"; do
EXCLUDE+=" --exclude=$FILE"
done
# Create the zip file
eval "zip -r $ZIPFILE $FILES_TO_ZIP$EXCLUDE"