Commit Graph
35 Commits
Author SHA1 Message Date
alvinlolloandClaude Opus 5.5 4fa5bc7d60 installbeta: bootstrap shelly before gum, harden failure logging
- Abort with a clear log_fatal when the up-front sudo -v fails, instead
  of an unexplained errexit later on.
- Move the shelly bootstrap ahead of any gum use, and install gum from
  pacman in its own non-fatal transaction: a repo set without gum or a
  stale sync db must not take base-devel/git down with it. No -Sy (that
  would be a partial upgrade); the gum safety net retries via shelly,
  and gum is dropped from the shelly prerequisite list.
- run_step: spinner via gum spin when gum exists, plain otherwise. The
  step's output is captured and replayed on failure through stdout, so
  makepkg/git errors land in $LOG rather than only on the terminal.
- try_step: one helper for the run / "try it manually" hint /
  record_failure blocks (7 copies). The hint is built from the command
  that ran, so it cannot drift. makepkg now uses -D (pacman >= 7.0) so
  the build step is a single command.
- Sudo keep-alive loop stops its own sleep from a TERM trap, replacing
  the racy pkill -P in cleanup; its stderr stays out of the log.

Verified: bash -n + shellcheck clean; try_step/run_step and the loop's
shutdown exercised with stub commands. Not run end to end on Arch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 11:38:50 +11:00
alvinlollo a7bf7e5330 installbeta: gum log errors, package count in install summary
- Route failures through log_error/log_fatal (gum log --level error/fatal
  with kitchen timestamps and colour), falling back to plain echo before
  the gum bootstrap. log_fatal guards against gum's fatal level exiting 1
  under errexit. record_failure uses log_error; $REPORT keeps plain
  colour-free lines for the gum pager.
- Fatal level on the four aborting errors (gum install failures, gum
  required, fish-shell refusal), error level on the non-fatal headlines
  and invalid menu option; the "run it manually" command blocks stay as
  plain echo.
- Snapshot the package database (pacman, else rpm) before the first
  install step and report the net delta in the INSTALL SUMMARY. apt-only
  systems report nothing, by request.
2026-10-08 16:15:39 +11:00
alvinlollo ec5c598829 installbeta: gum TUI menu, sudo keep-alive loop, install summary
- Ask for sudo once up front and refresh the timestamp in the background
  (250s, sudo -n true only) so shelly/makepkg stay un-sudo'd and the user
  is never re-prompted mid-run; the loop is killed by a cleanup EXIT trap
  that also removes WORK_DIR.
- Replace the numbered text menu with gum choose, wrap sub-script runs in
  gum spin, and add sudo -v checkpoints before each privileged menu step.
- Add an INSTALL SUMMARY block (log/report paths, failure count).
- Move the fish-shell refusal after the gum bootstrap so it can always
  use gum confirm; drop the ERR trap and hand-rolled select_options now
  that errexit + gum cover those paths.
2026-10-08 16:12:45 +11:00
alvinlollo bca2dd45ba zsh.sh nits: backup rotation, guarded rm, --needed, drop dead placeholder
- timestamped .zshrc backups (was: .zshrc.bak overwritten every run, so
  only the latest pre-run state survived)
- only remove ~/.oh-my-zsh when it actually contains oh-my-zsh.sh; warn
  and leave anything else alone (was: unguarded rm -rf)
- add --needed to the pacman prerequisite install
- drop the empty ~/.fzf/shell/key-bindings.zsh placeholder (nothing
  sourced it; fzf integration comes from the oh-my-zsh plugin)
- LICENSE spelling in banners (zsh.sh, installbeta.sh)
2026-10-08 14:16:37 +11:00
alvinlollo a012aeab9c installbeta.sh UX: docker group notice, drop fake command echoes and sleeps
- print a 'log out and back in' notice after usermod -aG docker (both
  fresh-install and already-installed branches; previously missing)
- remove the unexplained sleep 10 in the already-installed docker branch
- remove 'echo "+ sleep 10" && sleep 10' fake-command lines in failure
  branches (record_failure already reports the failure)
- affinity keeps its 10s read-the-instructions delay but announces it
  honestly instead of echoing a fake '+ 10 sleep' command
2026-10-08 14:15:00 +11:00
alvinlollo 23915c301a Strict mode from the start, contextual errors, non-zero exit in installbeta.sh
- set -Eeuo pipefail at the top (was only enabled after the menu, so
  package installs and shelly bootstrap ran unchecked); preamble audited
  for guarded vs unguarded commands ([ -t 1 ] && ... became an if, clear
  is now 'clear || true')
- error_handler now reports exit status, line number and the failing
  command, and the ERR trap is installed after strict mode so preamble
  failures abort instead of printing a message and continuing
- exit 1 when any step was recorded as failed (was: always exit 0)
- single STAMP shared by LOG and REPORT; both created via mktemp
  (predictable /tmp log names + tee -a was the same symlink class)
- local script/config fallbacks resolved via BASH_SOURCE (SCRIPT_DIR),
  not the caller's CWD; falls back to remote fetch when piped
- $? captured via rc=$? inside each failure branch (idempotent under
  reordering) for all record_failure call sites
- ${1:-} for the flag check, ${SHELL:-} in the fish detection,
  tty-guarded fish warning prompt
2026-10-08 14:13:57 +11:00
alvinlollo 0d605940b4 Harden installbeta.sh: temp workspace, curl -f, gum menu fallback
- mktemp -d workspace (trap-cleaned) for the shelly AUR clone, shelly toml
  downloads, docker installer and affinity script - no more predictable
  /tmp/shelly_install, /tmp/shelly-standard.toml, /tmp/shelly-aur.toml
- download get.docker.sh and AffinityLinuxInstaller.py with curl -fsSL to a
  file instead of piping to sh/python3 (the python pipe was missing -f, so an
  HTTP 404 body was executed as Python)
- plain numbered menu fallback when gum is unavailable (Fedora has neither
  shelly nor apt, so gum was never installed and 'gum choose' failed with a
  misleading 'User cancelled installation.')
- $? capture via rc=$? inside the failure branch (safe under reordering)
2026-10-08 14:10:43 +11:00
alvinlollo a38a007ce3 Migrate menu from whiptail to gum with label-based dispatch 2026-10-08 14:02:43 +11:00
alvinlollo 9049b0fc4b Fix remote script dump, add whiptail bash-not-fish warning 2026-09-23 22:57:40 +10:00
alvinlollo e57bc7e5c8 Reorganise 2026-08-10 17:23:13 +10:00
alvinlollo c748bfe210 Add bat script 2026-08-10 16:07:00 +10:00
alvinlollo 622d6f5ace Use shelly instead of pacman 2026-08-10 12:17:54 +10:00
alvinlollo 8d0f64d305 Add fish shell install and config 2026-06-20 23:13:24 +10:00
alvinlollo 71984cde3c Added affinity install with GUI by ryzendew 2026-03-31 07:29:19 +11:00
alvinlollo 6b59a46ea0 Fix syntax 2026-01-21 16:37:05 -08:00
alvinlollo 9e456e9877 Fix directory ending up in /tmp 2026-01-21 16:27:21 -08:00
alvinlollo 3a139a3563 Run local scripts first before using from github 2026-01-21 16:19:05 -08:00
alvinlollo fd6f3f5b37 Add guardrails and remove gdoc.vim 2026-01-21 14:51:50 -08:00
alvinlollo e98df34f7c Add comments, guardrails and --skip-watermark flag 2026-01-21 14:43:33 -08:00
alvinlollo 83cdf7f2b4 Add Disclaimer 2026-01-21 13:42:35 -08:00
alvinlollo cd357bd3ea Add GPL-2.0 licence disclaimer 2026-01-19 14:35:48 -08:00
Alvin Vilaythong a9e213a1eb Fix bugs 2025-11-12 11:23:23 +11:00
Alvin Vilaythong 3e45cfb170 Create installbeta.sh 2025-11-12 11:12:54 +11:00
Alvin Vilaythong 8eb6627d4d Make all scripts executible 2025-11-12 07:33:51 +11:00
alvinlollo be6aa3451c Update installbeta.sh 2025-04-14 16:42:27 +10:00
alvinlollo 648126f631 Update installbeta.sh 2025-04-14 16:39:00 +10:00
alvinlollo 9b94871715 Update installbeta.sh 2025-04-14 16:35:43 +10:00
alvinlollo 4e8e335c17 Update installbeta.sh 2025-04-14 16:29:29 +10:00
alvinlollo 07078b01b8 Update installbeta.sh 2025-04-14 16:23:25 +10:00
alvinlollo f7206eddac Fixed installbeta.sh 2025-04-14 16:21:32 +10:00
alvinlollo 18213f4a7f Fixed whiptail 2025-04-14 16:15:27 +10:00
alvinlollo c3c046a1d9 Update installbeta.sh 2025-04-14 15:57:25 +10:00
alvinlollo 98576bc457 Got rid of logs 2025-04-14 15:54:55 +10:00
alvinlollo 5fc434b848 Fixed docker install script 2025-04-14 15:31:57 +10:00
alvinlollo 637cad05d6 Added installbeta.sh
A future install script with a selection menu
2025-04-14 15:29:52 +10:00