diff --git a/.github/workflows/workstation-scripts.yml b/.github/workflows/workstation-scripts.yml index 7cdf80a..d8bf711 100644 --- a/.github/workflows/workstation-scripts.yml +++ b/.github/workflows/workstation-scripts.yml @@ -108,6 +108,22 @@ jobs: bash -n "$f" SOURCEOS_PROFILE_DIR=profiles/linux-dev/workstation-v0 bash "$f" --help >/dev/null + - name: Smoke: sourceos fix shell dry-run exits cleanly + run: | + set -euo pipefail + f='profiles/linux-dev/workstation-v0/bin/sourceos' + tmp=$(mktemp) + printf '# rc\n' > "$tmp" + SOURCEOS_PROFILE_DIR=profiles/linux-dev/workstation-v0 SOURCEOS_RC_FILES="$tmp" bash "$f" fix shell dry-run >/dev/null + + - name: Smoke: sourceos fix fish dry-run exits cleanly + run: | + set -euo pipefail + f='profiles/linux-dev/workstation-v0/bin/sourceos' + tmp=$(mktemp) + printf '# fish\n' > "$tmp" + SOURCEOS_PROFILE_DIR=profiles/linux-dev/workstation-v0 SOURCEOS_FISH_CONFIG="$tmp" bash "$f" fix fish dry-run >/dev/null + - name: Smoke: sourceos status JSON parses run: | set -euo pipefail diff --git a/docs/workstation/RUNBOOK.md b/docs/workstation/RUNBOOK.md index 0cfa033..d748ad3 100644 --- a/docs/workstation/RUNBOOK.md +++ b/docs/workstation/RUNBOOK.md @@ -64,17 +64,25 @@ Run: SOURCEOS_AUTOPATCH_SHELL=1 ./profiles/linux-dev/workstation-v0/install.sh ``` -Bash/Zsh helper: +Unified command surface: ```bash -./profiles/linux-dev/workstation-v0/bin/patch-shell.sh dry-run -./profiles/linux-dev/workstation-v0/bin/patch-shell.sh apply -./profiles/linux-dev/workstation-v0/bin/patch-shell.sh revert +sourceos fix shell dry-run +sourceos fix shell apply +sourceos fix shell revert + +sourceos fix fish dry-run +sourceos fix fish apply +sourceos fix fish revert ``` -Fish helper: +Low-level helpers remain available too: ```bash +./profiles/linux-dev/workstation-v0/bin/patch-shell.sh dry-run +./profiles/linux-dev/workstation-v0/bin/patch-shell.sh apply +./profiles/linux-dev/workstation-v0/bin/patch-shell.sh revert + ./profiles/linux-dev/workstation-v0/bin/patch-fish.sh dry-run ./profiles/linux-dev/workstation-v0/bin/patch-fish.sh apply ./profiles/linux-dev/workstation-v0/bin/patch-fish.sh revert @@ -98,6 +106,13 @@ The palette is invoked by: sourceos palette ``` +The palette includes: +- fix shell rc (dry-run/apply/revert) +- fix fish config (dry-run/apply/revert) +- status / doctor +- profile apply +- common TUI tools + --- ## 3) Ensure PATH includes ~/.local/bin diff --git a/profiles/linux-dev/workstation-v0/bin/sourceos b/profiles/linux-dev/workstation-v0/bin/sourceos index d397a9d..e352b98 100644 --- a/profiles/linux-dev/workstation-v0/bin/sourceos +++ b/profiles/linux-dev/workstation-v0/bin/sourceos @@ -44,7 +44,8 @@ sourceos (workstation helper) Usage: sourceos palette - sourceos fix shell [apply|dry-run] + sourceos fix shell [apply|dry-run|revert] + sourceos fix fish [apply|dry-run|revert] sourceos doctor [--open] sourceos status [--json|--open|--write ] sourceos profile apply @@ -52,6 +53,8 @@ Usage: Env: SOURCEOS_PROFILE_DIR Override profile directory (default: $PROFILE_DIR_DEFAULT) + SOURCEOS_RC_FILES Test hook for patch-shell.sh + SOURCEOS_FISH_CONFIG Test hook for patch-fish.sh EOF } @@ -96,6 +99,13 @@ run_fix_shell(){ exec "$s" "$mode" } +run_fix_fish(){ + local mode=${1:-apply} + local s="$PROFILE_DIR/bin/patch-fish.sh" + [[ -x "$s" ]] || { err "patch-fish helper missing: $s"; exit 2; } + exec "$s" "$mode" +} + gnome_detect(){ [[ "${XDG_CURRENT_DESKTOP:-}" == *GNOME* ]] && return 0 [[ "${DESKTOP_SESSION:-}" == *gnome* ]] && return 0 @@ -263,6 +273,10 @@ palette_menu(){ cat <<'EOF' Palette: Fix shell rc (dry-run) sourceos fix shell dry-run Palette: Fix shell rc (apply) sourceos fix shell apply +Palette: Revert shell rc patch sourceos fix shell revert +Palette: Fix fish config (dry-run) sourceos fix fish dry-run +Palette: Fix fish config (apply) sourceos fix fish apply +Palette: Revert fish config patch sourceos fix fish revert Status (open report) sourceos status --open Doctor (open report) sourceos doctor --open Apply profile sourceos profile apply @@ -323,6 +337,10 @@ main(){ shift || true run_fix_shell "${1:-apply}" ;; + fish) + shift || true + run_fix_fish "${1:-apply}" + ;; *) err "unknown fix target: ${1:-}" usage