Improve update scripts

This commit is contained in:
2026-06-21 13:21:28 +02:00
parent 691014286c
commit 52c10d7223
3 changed files with 13 additions and 18 deletions
+9 -13
View File
@@ -1,7 +1,5 @@
#!/usr/bin/env bash
CHANGES_PRODUCED=false
# Put here all apk update scripts
UPDATE_SCRIPTS=(
"./scripts/apk-update-scripts/sheetless.sh"
@@ -10,23 +8,21 @@ UPDATE_SCRIPTS=(
for script in "${UPDATE_SCRIPTS[@]}"; do
echo "--------------------------------"
echo "Executing: $script"
# Run the script
$script
# Capture the exit code immediately
if [ $? -eq 10 ]; then
echo " -> $script returned 10 (change)"
CHANGES_PRODUCED=true
fi
done
echo "--------------------------------"
# Sync all apks from the mounted dir to dest
SOURCE="/apks/"
DEST="/src/code/fdroid/repo/"
OUTPUT=$(rsync -avi --include="*.apk" --exclude="*" --delete "$SOURCE" "$DEST")
if [ "$CHANGES_PRODUCED" = true ]; then
echo "Result: At least one script produced a change"
# Check if the output contains the specific tags for new files (>f) or deleted files (*deleting)
if echo "$OUTPUT" | grep -q -E '^>f|^\*deleting'; then
echo "Changes detected! Files were copied or deleted."
exit 10
else
echo "Result: Not script produced a change"
echo "No APKs were added or removed. Skipping F-Droid update."
exit 0
fi