You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
style(shell): clear remaining ShellCheck warnings across 8.0.0 scripts (#660)
## Summary
Finishes the ShellCheck cleanup started in #652–#655. Applies the same
patterns that landed in the 7.0.4 image to the 8.0.0 image, plus the
glob-loop rewrite to `fsupgrade-{2..7}.sh`.
After this, every file covered by `.github/workflows/shellcheck.yml`
produces zero findings locally.
### Changes
- `docker/openemr/8.0.0/env.stub` — new stub file declaring runtime env
vars supplied by docker-compose, for SC2154 silencing. Pattern
established in #653/#655.
- `docker/openemr/8.0.0/openemr.sh` and `docker/openemr/8.0.0/ssl.sh`:
- Add the env.stub source wrapped in `if false; then … fi` so ShellCheck
follows it statically but the `.` command never runs at container
startup. BusyBox ash (Alpine's `/bin/sh`) exits on special-builtin
failure even with `|| true`, which is what broke the container in #655's
first attempt.
- `{ > file ; } &> /dev/null` → POSIX `: > file 2>/dev/null` (SC2188,
SC3020) with an expanded comment explaining why `set -o noclobber` +
O_CREAT|O_EXCL is the right TOCTOU-safe leader-election primitive.
- `echo -n` → `printf '%s'` (SC3037).
- Hoist `$(nproc --all)` to `jobs=` so ShellCheck can see its exit
status (SC2312).
- Inline `# shellcheck disable=SC2310` with an explanatory comment at
each retry-predicate `while` (`swarm_wait`, `! auto_setup`).
- `docker/openemr/8.0.0/upgrade/fsupgrade-{2..7}.sh` — rewrite `for X in
$(find sites/* -maxdepth 0 -type d)` as `for X in sites/*/; do
X="${X%/}"; sitename=${X##*/}` (SC2044, drops the `basename` subshell).
Matches #654.
### Clears
SC2044 (13), SC2154 (15), SC2188 (1), SC2310 (3), SC2312 (1), SC3020
(1), SC3037 (1).
## Test plan
- [x] `shellcheck --check-sourced --external-sources` over the full set
of 113 files matched by the workflow returns no findings
- [x] `bash -n` on each modified script passes
- [ ] CI green: ShellCheck + Production Docker
(7.0.4/8.0.0/8.1.0/8.1.1/binary/flex)
0 commit comments