chore: preserve local configuration edits before activation
This commit is contained in:
1 parent
fd96dc6dc0
commit
a71022f937
12 files changed
+217
-57
No files matched your search
+11
-2
@@ -5,6 +5,7 @@
|
||||
# fm -> OpenCode 2 through ~/.local/bin/oc2
|
||||
# fm-oc2 -> OpenCode 2 through ~/.local/bin/oc2, identical to fm
|
||||
# fm-pi -> Pi
|
||||
# fm-omp -> omp
|
||||
#
|
||||
# The check reads the zshrc that the real home-manager configuration generates
|
||||
# (the same file a rebuild installs), sources it in an interactive zsh, and runs
|
||||
@@ -12,6 +13,7 @@
|
||||
# - a `pi` spy first on PATH, which catches a Pi launch;
|
||||
# - a spy named by OPENCODE2_BIN, which the real ~/.local/bin/oc2 wrapper
|
||||
# execs instead of the OpenCode binary;
|
||||
# - an omp spy on PATH, used for the omp-harness launcher;
|
||||
# - the spies record their working directory, so a launcher that forgets the
|
||||
# `cd` into the firstmate home fails here.
|
||||
# Nothing here launches a real firstmate primary, Pi, or OpenCode, and the spies
|
||||
@@ -26,7 +28,7 @@ set -euo pipefail
|
||||
ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)
|
||||
MODE=source
|
||||
ZSHRC=''
|
||||
LAUNCHERS='fm:oc2 fm-oc2:oc2 fm-pi:pi'
|
||||
LAUNCHERS='fm:oc2 fm-oc2:oc2 fm-pi:pi fm-omp:omp'
|
||||
FM_HOME=${FM_HOME:-"$HOME/Documents/firstmate"}
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
@@ -61,7 +63,14 @@ for arg in "$@"; do printf '|%s' "$arg" >> "$FM_TEST_SPY_LOG"; done
|
||||
printf '\n' >> "$FM_TEST_SPY_LOG"
|
||||
exit 0
|
||||
SH
|
||||
chmod +x "$TMP/bin/pi" "$TMP/bin/opencode2-spy"
|
||||
cat > "$TMP/bin/omp" <<'SH'
|
||||
#!/usr/bin/env bash
|
||||
printf 'omp|%s' "$PWD" >> "$FM_TEST_SPY_LOG"
|
||||
for arg in "$@"; do printf '|%s' "$arg" >> "$FM_TEST_SPY_LOG"; done
|
||||
printf '\n' >> "$FM_TEST_SPY_LOG"
|
||||
exit 0
|
||||
SH
|
||||
chmod +x "$TMP/bin/pi" "$TMP/bin/opencode2-spy" "$TMP/bin/omp"
|
||||
printf '{}\n' > "$TMP/opencode.json"
|
||||
|
||||
case "$MODE" in
|
||||
|
||||
Reference in new issue
Block a user