Skip to content

Commit fb193e8

Browse files
committed
Use grep for matching args with sh
Fixes the following shellcheck error: SC2081 (error): [ .. ] can't match globs. Use a case statement. https://www.shellcheck.net/wiki/SC2081
1 parent 3529811 commit fb193e8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

test/scripts/enable-kargs_test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ setUp() {
4040
cp $(which cat) ${FAKE_HOST}/usr/bin/
4141
cp $(which test) ${FAKE_HOST}/usr/bin/
4242
cp $(which sh) ${FAKE_HOST}/usr/bin/
43+
cp $(which grep) ${FAKE_HOST}/usr/bin/
4344
cp "$SCRIPTPATH/rpm-ostree_mock" ${FAKE_HOST}/usr/bin/rpm-ostree
4445
}
4546

test/scripts/rpm-ostree_mock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Write invocation with arguments to a file to allow making assertion.
66
echo "$*" >> /rpm-ostree_calls
77

8-
if [ "$*" != *"--append"* ]
8+
if ! echo "$*" | grep -q "\--append"
99
then
1010
# Caller is trying to read kernel arguments.
1111
cat /proc/cmdline

0 commit comments

Comments
 (0)