fix(packaging): isolate nightly config dir, fix Exec sed delimiter, and satisfy SonarCloud

This commit is contained in:
Dylan M. Taylor committed 2026-11-24 15:26:18 -05:00
1 parent 2308f97ecd
commit 306fde8475
4 files changed
+22 -3

No files matched your search

+3
View File
@@ -1,5 +1,8 @@
#!/bin/sh
set -eu
if [ -z "${EFFECTCRAFT_CONFIG_DIR:-}" ]; then
export EFFECTCRAFT_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/effectcraft-nightly"
fi
real_bin="$(dirname "$0")/.effectcraft-nightly/effectcraft"
exec "$real_bin" "$@"
+1 -1
View File
@@ -28,7 +28,7 @@ bin="$work/installed/bin"
mv "$bin/effectcraft" "$bin/effectcraft-nightly"
mv "$bin/effectcraft-cli" "$bin/effectcraft-nightly-cli"
test ! -e "$stage/bin/.effectcraft-nightly"
[[ ! -e "$stage/bin/.effectcraft-nightly" ]]
cmp "$stage/bin/effectcraft" "$bin/.effectcraft-nightly/effectcraft"
cmp "$stage/bin/effectcraft-cli" "$bin/effectcraft-nightly-cli"
expect() {
+14 -2
View File
@@ -155,13 +155,16 @@ if has deb || has rpm; then
cat >"$NFPM_STAGE/usr/bin/$NFPM_BIN" <<'WRAPPER'
#!/bin/sh
set -eu
if [ -z "${EFFECTCRAFT_CONFIG_DIR:-}" ]; then
export EFFECTCRAFT_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/effectcraft-nightly"
fi
exec /usr/lib/effectcraft-nightly/effectcraft "$@"
WRAPPER
chmod 755 "$NFPM_STAGE/usr/bin/$NFPM_BIN"
rm -f "$NFPM_STAGE/usr/bin/effectcraft"
mv "$NFPM_STAGE/usr/bin/effectcraft-cli" "$NFPM_STAGE/usr/bin/$NFPM_CLI"
mv "$NFPM_STAGE/usr/share/doc/effectcraft" "$NFPM_STAGE/usr/share/doc/$NFPM_NAME"
sed -e "s|^Exec=effectcraft\([[:space:]]\|$\)|Exec=$NFPM_BIN\1|" \
sed -e "s#^Exec=effectcraft\([[:space:]]\|$\)#Exec=$NFPM_BIN\1#" \
-e "s|^TryExec=effectcraft$|TryExec=$NFPM_BIN|" \
-e "s|^Icon=$APP_ID$|Icon=$NIGHTLY_DESK_ID|" \
-e "s|^Name=EffectCraft$|Name=EffectCraft Nightly|" \
@@ -216,8 +219,16 @@ if has appimage; then
cp -R "$STAGE" "$APPDIR"
# Keep sctk-adwaita's MIT notice in the AppImage.
install -Dm644 "$ROOT/NOTICE" "$APPDIR/usr/share/doc/effectcraft/NOTICE"
ln -s usr/bin/effectcraft "$APPDIR/AppRun"
if [[ "$IS_NIGHTLY" = 1 ]]; then
cat >"$APPDIR/AppRun" <<'APPRUN'
#!/bin/sh
set -eu
if [ -z "${EFFECTCRAFT_CONFIG_DIR:-}" ]; then
export EFFECTCRAFT_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/effectcraft-nightly"
fi
exec "$(dirname "$0")/usr/bin/effectcraft" "$@"
APPRUN
chmod 755 "$APPDIR/AppRun"
APPIMAGE_ID="$APP_ID.nightly-v1"
sed -e "s|^Icon=$APP_ID$|Icon=$APPIMAGE_ID|" \
-e "s|^Name=EffectCraft$|Name=EffectCraft Nightly|" \
@@ -233,6 +244,7 @@ if has appimage; then
cp "$NIGHTLY_ICON" "$APPDIR/$APPIMAGE_ID.png"
ln -s "$APPIMAGE_ID.png" "$APPDIR/.DirIcon"
else
ln -s usr/bin/effectcraft "$APPDIR/AppRun"
cp "$HERE/$APP_ID.desktop" "$APPDIR/$APP_ID.desktop"
cp "$ROOT/assets/app-icon/hicolor/256x256/apps/$APP_ID.png" "$APPDIR/$APP_ID.png"
ln -s "$APP_ID.png" "$APPDIR/.DirIcon"
+4
View File
@@ -6,6 +6,10 @@ sonar.organization=storytold
# shipped or run by the app or CI, so they are not analysed.
sonar.exclusions=crates/aep/tests/fixtures/tools/**
# Packaging test scripts are self-contained unittest suites run directly by CI, not app source
# covered by Rust coverage reports.
sonar.coverage.exclusions=packaging/**/*-tests.py,packaging/**/*_test.py
# S1523 / S2137 (eval, Function): the expression runtime in crates/expr/src/prelude.js replaces
# `eval` and `Function` on purpose, with wrappers that check the code they are given before it
# runs (After Effects expressions may call them). The rules flag exactly that wrapping.