From 3c3b4e62fd67455aecbb34fdfce058677db6ac6e Mon Sep 17 00:00:00 2001 From: iris <2+iris@noreply.localhost> Date: Wed, 2 Sep 2026 06:24:18 -0400 Subject: [PATCH] Declare build modes and the Enroll command for Dev Updater modes: [release, debug], release first as the default; build-apk.sh already takes the mode as its last argument, which is how Dev Updater passes it. enroll: goes through server/enroll-link.sh rather than the binary directly, because the command is handed the app's mode too and because the server may have been built in either profile -- the wrapper ignores the word and takes whichever ai-server exists, release first. Co-Authored-By: Claude Fable 5.1 --- .dev-updater.ron | 10 ++++++++++ server/enroll-link.sh | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100755 server/enroll-link.sh diff --git a/.dev-updater.ron b/.dev-updater.ron index 30df5a5..3e23272 100644 --- a/.dev-updater.ron +++ b/.dev-updater.ron @@ -39,10 +39,20 @@ components: [ ), Apk( name: "app", + // Release first: the first mode is the default, and the phone runs + // the release build -- a debuggable one runs Compose at a fraction + // of the speed. Each command below is run with the chosen mode as + // its last argument, which is exactly build-apk.sh's interface. + modes: ["release", "debug"], // Resolved against this directory, and run in `app/` -- the script // cds to its own directory anyway, so the cwd is here to say where // the app is rather than because the build needs it. build: "app/build-apk.sh", cwd: "app", + // The Enroll button in this component's settings: prints the link + // that enrols the phone against the server built here, for the + // reinstalls -- a signing change, a new phone -- where nobody is at + // the terminal the QR would be printed on. + enroll: "server/enroll-link.sh", ), ], diff --git a/server/enroll-link.sh b/server/enroll-link.sh new file mode 100755 index 0000000..38a11d3 --- /dev/null +++ b/server/enroll-link.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# Prints an enrollment link for one more phone -- `ai-server --enroll-link`, +# see that flag's help. This is what Dev Updater's Enroll button runs, from +# the checkout root, with the *app's* build mode as a trailing argument +# (every command a component declares gets it). The mode does not bear on +# the server, so it is ignored: the link comes from whichever ai-server has +# been built here, release first, and the message below is what the card +# shows when neither exists. +set -eu +cd "$(dirname "$0")" +for bin in target/release/ai-server target/debug/ai-server; do + if [ -x "$bin" ]; then + exec "$bin" --enroll-link + fi +done +echo "ai-server is not built here yet -- update the server component first" >&2 +exit 1