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
+2 -1
View File
@@ -14,12 +14,13 @@ if [ ! -d "./code/.git" ]; then
cd ./code
./scripts/decrypt.sh
echo "Done"
else
cd "./code"
fi
echo "Running regular repo update..."
echo ""
cd "./code"
git fetch origin
LOCAL=$(git rev-parse HEAD)
REMOTE=$(git rev-parse "origin/$BRANCH")
+2 -4
View File
@@ -9,8 +9,7 @@ REPO_OWNER="julian"
REPO_NAME="sheetless"
APP_NAME="de.frajul.sheetless"
TARGET_ASSET_NAME="app-release.apk"
FDROID_REPO_DIR="./fdroid/repo"
FDROID_ARCHIVE_DIR="./fdroid/archive"
APK_DIR="/apks"
# ==========================================
# SETUP & API CALL
@@ -44,8 +43,7 @@ while IFS=$'\t' read -r TAG DOWNLOAD_URL; do
# Skip empty lines if jq returns nothing
[[ -z "$TAG" ]] && continue
LOCAL_FILE="$FDROID_REPO_DIR/${APP_NAME}_${TAG}.apk"
ARCHIVE_FILE="$FDROID_ARCHIVE_DIR/${APP_NAME}_${TAG}.apk"
LOCAL_FILE="$APK_DIR/${APP_NAME}_${TAG}.apk"
echo "Checking release: $TAG..."
+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