Files
vectorcraft/packaging/linux/nightly-launch.sh
skylartaylor 4176f92190 nightly: fix the review round for the VectorCraft flavor
A handled startup error is a controlled return: only a caught panic keeps the
Nightly session record (finish_after(outcome.is_ok())), and the unclean-session
notice no longer replaces a graphics, plug-in or hang message that is already up.

The profile fences cover HOME's own XDG folders when an override moves the
effective ones, a dangling stable entry point keeps its fence instead of
refusing every launch, and an empty VECTORCRAFT_NO_PREFS is refused as the app
treats it. The recovery store refuses to write through a linked entry, as it
already refused to read one.

The Arch handoff stages the GUI in the hidden folder and leaves the launcher in
place; the launcher answers a version, help or Launcher query before it needs a
profile root; the archive collision test follows the volume's case rule; the
Windows nightly copies ASSETS.md, builds into the target folder it then reads,
and the stable packager refuses an executable with no stable VERSIONINFO; the
macOS signing fixtures name no credential and no /tmp.
2026-11-25 09:33:31 +01:00

46 lines
1.9 KiB
Bash
Executable File

#!/bin/sh
# The launcher every VectorCraft Nightly format starts: the same file in the plain tar (`vectorcraft`),
# the deb/rpm (`/usr/bin/vectorcraft-nightly`), the AppImage (`AppRun`), the Arch handoff
# (`bin/vectorcraft`) and the Flatpak (`/app/bin/vectorcraft`). It starts the GUI beside it
# (`<app>-bin`, the standard Nightly layout) in the nightly-v1 channel's own profile.
#
# An invocation that carries the Launcher's protocol, or a bare version or help query, goes straight
# to the GUI: it answers those before it validates a profile root, and it treats everything after
# `--` as a file. Everything else gets the channel's profile root and the `--` delimiter.
set -eu
case "$0" in
*/*) here="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)" ;;
# Started from PATH: the program that ran is the one to look beside.
*) here="$(CDPATH='' cd -- "$(dirname -- "$(command -v -- "$0")")" && pwd)" ;;
esac
real_bin=
for candidate in \
"$here/vectorcraft-bin" \
"$here/usr/bin/vectorcraft-bin" \
"$here/.vectorcraft-nightly/vectorcraft-bin" \
"$here/../lib/vectorcraft-nightly/vectorcraft-bin" \
"$here/../libexec/vectorcraft-bin"; do
if [ -x "$candidate" ] && [ ! -d "$candidate" ]; then
real_bin="$candidate"
break
fi
done
[ -n "$real_bin" ] || {
echo 'VectorCraft Nightly: the app binary is missing beside this launcher' >&2
exit 2
}
case "${1:-}" in
# These branches need no profile root, so they answer even where HOME is unset.
--version | -V | --help | -h | --launch-profile) exec "$real_bin" "$@" ;;
esac
profile_root="${XDG_DATA_HOME:-${HOME:?HOME is required}/.local/share}/vectorcraft-nightly"
if [ "${1:-}" = "--" ]; then
# The caller supplied the file delimiter already: never send two.
shift
exec "$real_bin" --launch-profile nightly-v1 --profile-root "$profile_root" -- "$@"
fi
exec "$real_bin" --launch-profile nightly-v1 --profile-root "$profile_root" -- "$@"