Skip to content

fix(installer): harden install.sh and color-build.sh under set -eu#127

Open
soleynn wants to merge 2 commits into
mainfrom
script-hardening
Open

fix(installer): harden install.sh and color-build.sh under set -eu#127
soleynn wants to merge 2 commits into
mainfrom
script-hardening

Conversation

@soleynn

@soleynn soleynn commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

harden install.sh and color-build.sh so they run cleanly under set -eu.

  • set -eu on both scripts, with the ${1:-} / var-init / guarded-read fixes that needs
  • scope dependency checks per debug mode and run them after arg validation, so the
    build-only modes (color/aurorae/splash/cursor) work headless and a bad arg reports
    the right error instead of "Dependency not met"
  • verify the cursor download (wget exit + non-empty zip) before unzip
  • color-build: exact flavour case match instead of an unanchored grep that accepted
    substrings like XMochaX
  • *) default arms, mkdir -p, and a tty-guarded clear so set -e doesn't trip
  • shfmt normalize first, as its own commit

color output is byte-identical across all 56 flavour/accent combos.

soleynn added 2 commits June 22, 2026 21:40
run shfmt -ln posix -i 4 -ci over both scripts to fix the tab/space
drift before the hardening pass. no behaviour change.
run both scripts under set -eu so the failures set -e used to swallow now
surface, with the guards that needs:

- default ${1:-} for the positional args, init CONFIRMATION/OUT/SOURCE/
  FLAVOURNAME, and guard the read prompts with || true so EOF or a missing
  trailing newline doesn't abort
- *) arms on the inner flavour cases plus the Latte selFg and getopts cases
  so add-default-case (SC2249) stays clean
- mkdir -p in BuildSplashScreen so a re-run doesn't trip on an existing dir
- route clear through a clear_screen helper gated on [ -t 1 ]; clear errors
  on a dumb tty and wipes diagnostics in ci
- scope the dependency checks per debug mode: only the full install needs
  kpackagetool6 + kwriteconfig6 + plasma-apply-lookandfeel, and the checks
  run after arg validation so a bad arg reports the right error headless
- verify the cursor download (wget exit + non-empty zip) before unzip, with
  a clear store/network error
- color-build: exact case match for the flavour instead of the unanchored
  grep that accepted substrings like XMochaX

color output is byte-identical across all 56 flavour/accent combos.
@soleynn soleynn added type: enhancement New feature or request area: installer install.sh and the build scripts status: waiting Waiting on action from the author type: bug Something isn't working labels Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: installer install.sh and the build scripts status: waiting Waiting on action from the author type: bug Something isn't working type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant