ask where Officer should be installed, in pre-flight
OFFICER_ROOT, defaulting to <user home>/officerdev. One directory holding the four things Officer is made of, per docs/sidecar-app-store.md — the app, its data, the item store, and any containers the app store provisions — so the whole installation can be moved, backed up or deleted as a unit. Asked at the start with the other questions rather than at the point it is first needed. It decides the shape of several later steps: where the repository is cloned, where DATA_PATH sits beside it, and which filesystem the app store's bind mounts come out of. Asking once up front also means the run can be described before it starts rather than discovered as it goes. A leading ~ is expanded explicitly. It arrives as a literal from a read or an environment variable — nothing expands it there — and would otherwise create a directory actually named "~" in whatever the working directory happened to be. Relative paths are refused with the value named, and a trailing slash is trimmed so the path composes cleanly with what gets appended to it. Nothing creates the directory yet; that belongs to officer-setup. This records the answer and reports it, including whether it already exists. Verified: Enter takes the default, ~ expands, trailing slash trims, OFFICER_ROOT in the environment skips the prompt, and a relative path fails with the value named. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -78,6 +78,13 @@ fi
|
||||
|
||||
USER_HOME="/home/$USERNAME"
|
||||
|
||||
ask_officer_root
|
||||
if [[ -d "$OFFICER_ROOT" ]]; then
|
||||
info "Officer: ${OFFICER_ROOT} (exists already)"
|
||||
else
|
||||
info "Officer: ${OFFICER_ROOT}"
|
||||
fi
|
||||
|
||||
# Always, and outside any step: everything below reads this index — core utils,
|
||||
# the fastfetch PPA, the Docker repo — and `step` skips a step whose name is
|
||||
# already in the progress file. With the refresh inside one of those, a resumed
|
||||
@@ -579,6 +586,7 @@ echo " System: $OS_NAME ($ARCH)"
|
||||
echo " Role: $MACHINE_ROLE"
|
||||
echo " User: $USERNAME"
|
||||
echo " Home: $USER_HOME"
|
||||
echo " Officer: $OFFICER_ROOT"
|
||||
[[ -n "${TS_IP:-}" && "$TS_IP" != "unknown" ]] && echo " Tailscale: $TS_IP"
|
||||
echo ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user