mirror of
https://github.com/curl/curl.git
synced 2026-04-15 00:31:41 +03:00
OS400: fix shellcheck warnings in scripts
- use `$()` instead of backticks, and re-arrange double-quotes inside.
- add missing `|| exit 1` to `cd` calls. (could be dropped by using `set -eu`.)
- add `-n` to a few `if`s.
- shorten redirections by using `{} >` (as shellcheck recommended).
- silence warnings where variables were detected as unused (SC2034).
- a couple misc updates to silence warnings.
- switch to bash shebang for `-ot` feature.
- split two lines to unbreak syntax highlighting in my editor. (`$(expr \`, `$(dirname \`)
Also enable CI checks for OS/400 shell scripts.
Ref: #13307
Closes #13309
This commit is contained in:
parent
8dd81bd5db
commit
8a622baf9e
8 changed files with 106 additions and 92 deletions
4
.github/scripts/shellcheck.sh
vendored
4
.github/scripts/shellcheck.sh
vendored
|
|
@ -3,10 +3,8 @@
|
|||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
|
||||
# FIXME: packages/OS400/* scripts
|
||||
|
||||
shellcheck --version
|
||||
# shellcheck disable=SC2046
|
||||
shellcheck --exclude=1091 \
|
||||
--enable=avoid-nullary-conditions,deprecate-which \
|
||||
$(grep -l -E '^#!(/usr/bin/env bash|/bin/sh|/bin/bash)' $(git ls-files | grep -v -F 'packages/OS400/'))
|
||||
$(grep -l -E '^#!(/usr/bin/env bash|/bin/sh|/bin/bash)' $(git ls-files))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue