Commit 3ebe7ee
authored
apacheGH-46909: [CI][Dev] Fix shellcheck errors in the ci/scripts/install_sccache.sh (apache#46910)
### Rationale for this change
This is the sub issue apache#44748.
```
shellcheck ci/scripts/install_sccache.sh
In ci/scripts/install_sccache.sh line 22:
if [ "$#" -lt 1 -o "$#" -gt 3 ]; then
^-- SC2166 (warning): Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
In ci/scripts/install_sccache.sh line 42:
curl -L $SCCACHE_URL --output $SCCACHE_ARCHIVE
^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
curl -L "$SCCACHE_URL" --output $SCCACHE_ARCHIVE
In ci/scripts/install_sccache.sh line 43:
curl -L $SCCACHE_URL.sha256 --output $SCCACHE_ARCHIVE.sha256
^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
curl -L "$SCCACHE_URL".sha256 --output $SCCACHE_ARCHIVE.sha256
In ci/scripts/install_sccache.sh line 53:
sha256sum $SHA_ARGS $SCCACHE_ARCHIVE.sha256
^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
sha256sum "$SHA_ARGS" $SCCACHE_ARCHIVE.sha256
In ci/scripts/install_sccache.sh line 55:
if [ ! -d $PREFIX ]; then
^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
if [ ! -d "$PREFIX" ]; then
In ci/scripts/install_sccache.sh line 56:
mkdir -p $PREFIX
^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
mkdir -p "$PREFIX"
In ci/scripts/install_sccache.sh line 61:
tar -xzvf $SCCACHE_ARCHIVE --strip-component=1 --directory $PREFIX --exclude="sccache*/*E*E*"
^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
tar -xzvf $SCCACHE_ARCHIVE --strip-component=1 --directory "$PREFIX" --exclude="sccache*/*E*E*"
In ci/scripts/install_sccache.sh line 62:
chmod a+x $PREFIX/sccache
^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
chmod a+x "$PREFIX"/sccache
In ci/scripts/install_sccache.sh line 65:
echo "$PREFIX" >> $GITHUB_PATH
^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
echo "$PREFIX" >> "$GITHUB_PATH"
In ci/scripts/install_sccache.sh line 67:
echo "SCCACHE_PATH=$PREFIX/sccache.exe" >> $GITHUB_ENV
^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
echo "SCCACHE_PATH=$PREFIX/sccache.exe" >> "$GITHUB_ENV"
For more information:
https://www.shellcheck.net/wiki/SC2166 -- Prefer [ p ] || [ q ] as [ p -o q...
https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
```
### What changes are included in this PR?
* SC2086: Use multiple tests.
* SC2086: Quoting variables.
### Are these changes tested?
Yes.
### Are there any user-facing changes?
No.
* GitHub Issue: apache#46909
Authored-by: Hiroyuki Sato <hiroysato@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>1 parent 0b34e6b commit 3ebe7ee
2 files changed
+13
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| 328 | + | |
328 | 329 | | |
329 | 330 | | |
330 | 331 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
| 42 | + | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | | - | |
56 | | - | |
| 55 | + | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
| 61 | + | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
0 commit comments