fix(installer): harden install.sh and color-build.sh under set -eu#127
Open
soleynn wants to merge 2 commits into
Open
fix(installer): harden install.sh and color-build.sh under set -eu#127soleynn wants to merge 2 commits into
soleynn wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
harden install.sh and color-build.sh so they run cleanly under
set -eu.set -euon both scripts, with the${1:-}/ var-init / guarded-read fixes that needsbuild-only modes (color/aurorae/splash/cursor) work headless and a bad arg reports
the right error instead of "Dependency not met"
casematch instead of an unanchored grep that acceptedsubstrings like XMochaX
*)default arms,mkdir -p, and a tty-guardedclearso set -e doesn't tripcolor output is byte-identical across all 56 flavour/accent combos.