Files
gridcraft/packaging/linux/nightly-launch.sh
T
skylartaylor c1e55f8d27 Nightly: keep Dylan's callers, fix rustfmt, ship the kit's tar layout
- Put his nightly.yml, nightly-sign.yml and installed signing policy back byte
  for byte (no `false &&`, his five manual actors, his 605d5876 pin), and drop
  our dormant duplicates: nightly-dispatch.yml, the policy template and the
  actionlint waiver that only hid the `queue:` key he removed.
- Adapt nightly-release-tests.py to the enabled pair: no schedule, his exact
  context guards, the release managers in caller and policy, one pin, the
  installed policy's fields and platforms, plus this branch's guards for the
  committed Linux key and the Sonar fixture scope.
- cargo fmt --all (17 hunks in 7 files); clean under rustfmt 1.10 and 1.100.
- Flat nightly tar uses the kit layout: `gridcraft` is the launcher and
  `gridcraft-bin` the GUI it starts, and the launcher never starts itself.
- docs: his go-live doc, one stale sentence corrected, plus a flavor section.
- Drop the unused GRIDCRAFT_CONFIG_DIR stable knob; an empty XDG_CONFIG_HOME
  now falls back to ~/.config.
2026-11-25 00:08:19 +01:00

35 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
# GridCraft Nightly launcher for a moved tree: an AppImage (AppRun and usr/bin), the plain nightly
# tar, or a distro tarball's usr/bin. The launch profile is the only data root a nightly build
# accepts, so this is what keeps a Nightly run out of the stable app's settings, prefs and logs.
set -eu
here="$(cd "$(dirname "$0")" && pwd)"
# Where each placement keeps the GUI it starts: the AppImage (and any installed tree) has it in
# usr/bin/gridcraft; the flat nightly tar names it gridcraft-bin beside this launcher; a plain
# tree tarball keeps it beside its bin/gridcraft-nightly. A candidate that is this same file is
# never started, so a launcher can not recurse into itself.
self="$here/$(basename "$0")"
real=""
for candidate in "$here/usr/bin/gridcraft" "$here/gridcraft-bin" "$here/gridcraft"; do
if [ -x "$candidate" ] && [ ! "$candidate" -ef "$self" ]; then
real="$candidate"
break
fi
done
if [ -z "$real" ]; then
echo "gridcraft-nightly: no GridCraft binary beside $0 (usr/bin/gridcraft, gridcraft-bin)" >&2
exit 2
fi
if [ -z "${XDG_DATA_HOME:-}" ] && [ -z "${HOME:-}" ]; then
echo "gridcraft-nightly: XDG_DATA_HOME and HOME are both unset, so there is no Nightly data folder" >&2
exit 2
fi
# A bare version query and the Launcher's own protocol pass straight through.
case "${1-}" in
--launch-profile | --profile-root) exec "$real" "$@" ;;
esac
if [ "$#" -eq 1 ] && { [ "${1-}" = "--version" ] || [ "${1-}" = "-V" ]; }; then
exec "$real" "$@"
fi
exec "$real" --launch-profile nightly-v1 --profile-root "${XDG_DATA_HOME:-$HOME/.local/share}/gridcraft-nightly/profile" -- "$@"