Re-render the launcher from #363's pass-through template

Re-rendered from craft-common-actions #363's new head (5ee7780), which passes the
Launcher's own profile line through:

  --launch-profile) exec "$target" "$@" ;;

The ArtCraft Launcher starts the entry point with its own profile pair and per-install
root, so that line now reaches the GUI unchanged; a version query still answers with one
plain --version and every other argument still gets the template's fixed profile root.

The tar tests pin the pass-through and keep the wrapped cases (a --profile-root that does
not open the arguments, the `=` spelling, --help), and every suite is rerun.
This commit is contained in:
skylartaylor
2026-11-25 17:14:36 +01:00
parent 33a733b2dd
commit 9d41c9df7a
2 changed files with 11 additions and 3 deletions
+9 -3
View File
@@ -61,10 +61,14 @@ expect "$flat/deckcraft" "$(tar_argv; printf '<%s>\n' 'deck with spaces.pptx' '-
# Both version spellings reach the GUI as one plain `--version`.
expect "$flat/deckcraft" "$(printf '<%s>\n' --launch-profile nightly-v1 --profile-root "$tar_profile" --version)" --version
expect "$flat/deckcraft" "$(printf '<%s>\n' --launch-profile nightly-v1 --profile-root "$tar_profile" --version)" -V
# Every other argument is a file argument, including one that looks like a query or a profile.
# The ArtCraft Launcher starts the entry point with its own profile pair; the template hands that
# line to the GUI unchanged.
launcher_line=(--launch-profile nightly-v1 --profile-root "$work/launcher root" -- deck.pptx)
expect "$flat/deckcraft" "$(printf '<%s>\n' "${launcher_line[@]}")" "${launcher_line[@]}"
# Anything else is a file argument with the template's own profile, including a query the template
# does not answer (`--help`) and a profile line that does not open the arguments.
expect "$flat/deckcraft" "$(tar_argv; printf '<%s>\n' --help)" --help
expect "$flat/deckcraft" "$(tar_argv; printf '<%s>\n' --launch-profile nightly-v1 --profile-root "$work/launcher" -- deck.pptx)" \
--launch-profile nightly-v1 --profile-root "$work/launcher" -- deck.pptx
expect "$flat/deckcraft" "$(tar_argv; printf '<%s>\n' --profile-root "$work/launcher" --)" --profile-root "$work/launcher" --
test ! -e "$tar_profile"
# The launcher resolves its own folder physically and starts only the GUI beside it.
linked="$work/linked/bin"
@@ -133,6 +137,8 @@ fi
grep -Fq '# Nightly launcher generated by craft-common-actions scripts/nightly-launcher.sh.in.' "$launcher"
# shellcheck disable=SC2016
grep -Fq 'target="$dir/deckcraft-bin"' "$launcher"
# shellcheck disable=SC2016
grep -Fq ' --launch-profile) exec "$target" "$@" ;;' "$launcher"
grep -Fq "}/$identity\"" "$launcher"
echo "PASS: the nightly tar's template launcher and the distro launcher start the GUI with their profile"
+2
View File
@@ -9,6 +9,8 @@ readonly target
profile_root="${XDG_DATA_HOME:-$HOME/.local/share}/ai.storyteller.deckcraft.nightly"
readonly profile_root
case "${1-}" in
# The ArtCraft Launcher passes its own profile and per-install root; the app validates the pair.
--launch-profile) exec "$target" "$@" ;;
--version | -V) exec "$target" --launch-profile nightly-v1 --profile-root "$profile_root" --version ;;
esac
exec "$target" --launch-profile nightly-v1 --profile-root "$profile_root" -- "$@"