Fix AppImage post-step aborting on no-op mv.

linuxdeploy already writes the final path; renaming the file onto itself failed under set -e.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
pepaskopec-blip 2026-09-16 12:43:29 +02:00
commit b49c456098

View file

@ -97,20 +97,27 @@ run_linuxdeploy \
--plugin gtk \ --plugin gtk \
--output appimage --output appimage
# linuxdeploy may write the AppImage into the cwd; normalise the name/location. # linuxdeploy may write the AppImage into the cwd under another name;
shopt -s nullglob # only rename when it is not already at the expected path (mv same→same
for f in "$ROOT"/*.AppImage "$ROOT/dist"/*.AppImage; do # fails under `set -e` and was aborting an otherwise successful build).
DEST="$ROOT/dist/$OUT_NAME"
if [[ ! -f "$DEST" ]]; then
shopt -s nullglob
for f in "$ROOT"/*.AppImage "$ROOT/dist"/*.AppImage; do
case "$(basename "$f")" in case "$(basename "$f")" in
linuxdeploy*|appimagetool*) continue ;; linuxdeploy*|appimagetool*) continue ;;
esac esac
mv -f "$f" "$ROOT/dist/$OUT_NAME" mv -f "$f" "$DEST"
done break
shopt -u nullglob done
shopt -u nullglob
fi
if [[ ! -f "$ROOT/dist/$OUT_NAME" ]]; then if [[ ! -f "$DEST" ]]; then
echo "AppImage was not created" >&2 echo "AppImage was not created" >&2
find "$ROOT" "$ROOT/dist" -maxdepth 2 -name '*.AppImage' -print >&2 || true
exit 1 exit 1
fi fi
chmod +x "$ROOT/dist/$OUT_NAME" chmod +x "$DEST"
echo "Created dist/$OUT_NAME" echo "Created dist/$OUT_NAME"