Files
vectorcraft/packaging/linux/nightly-launch.sh
T
Dylan M. Taylor 8b0b808857 packaging(linux): support co-installable nightly packages (#9233)
Linux nightly packaging by @dylanmtaylor, with the per-app Nightly flavor commits stacked on his branch.

gate test shard 1/5 (and the Sonar scan that reads its coverage) fails on crates/ui-egui/src/doc_windows/tests.rs `a_document_made_current_in_presentation_mode_comes_to_the_front_after_it`, which main fails too (CI run 45581083304); this PR touches no ui-egui code.

Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
2026-11-25 06:01:37 -06: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" -- "$@"