Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/workstation-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 20 additions & 5 deletions docs/workstation/RUNBOOK.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
20 changes: 19 additions & 1 deletion profiles/linux-dev/workstation-v0/bin/sourceos
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,17 @@ 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 <path>]
sourceos profile apply
sourceos profile path

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
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down