diff --git a/desktop/packaging/publish-release.sh b/desktop/packaging/publish-release.sh index f3b18f2..ae27987 100755 --- a/desktop/packaging/publish-release.sh +++ b/desktop/packaging/publish-release.sh @@ -74,6 +74,18 @@ ASSETS=( "$REPO_ROOT"/android/dist/thoughtsync.apk "$REPO_ROOT"/android/dist/thoughtsync-android.json ) +# nullglob drops PATTERNS that match nothing — it does nothing for a path with no +# wildcard in it, which stays in the array as a literal and reaches curl as a file +# that isn't there (exit 26). The Android entries above are exactly that shape, and +# adding them broke the desktop publish that had been working. Filter on existence +# instead, which is what the array actually means and covers every entry rather +# than only the ones that happen to contain a `*`. +present=() +for a in "${ASSETS[@]}"; do + [ -f "$a" ] && present+=("$a") +done +ASSETS=("${present[@]}") + if [ ${#ASSETS[@]} -eq 0 ]; then echo "ERROR: nothing to publish — no desktop bundles under $BUNDLE_ROOT and no APK under $REPO_ROOT/android/dist." >&2 exit 1