2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-01 15:06:06 +00:00

Fix Shellcheck errors

Fix SC2045 (error): Iterating over ls output is fragile. Use globs.

Add exception SC2068 exception for confluent_client/confluent_env.sh as this is intended.
SC2068 (error): Double quote array expansions to avoid re-splitting elements.
This commit is contained in:
Markus Hilger
2026-07-13 05:29:49 +02:00
parent 0272137e94
commit 6d606f37f6
3 changed files with 8 additions and 6 deletions
+2
View File
@@ -53,6 +53,8 @@ _confluent_get_args()
CMPARGS+=("")
fi
GENNED=""
# Whitespace separates candidate groups, while commas group synonyms.
# shellcheck disable=SC2068
for CAND in ${COMP_CANDIDATES[@]}; do
candarray=(${CAND//,/ })
matched=0
@@ -34,8 +34,8 @@ done
if [ -e /tmp/installdisk ]; then
instdisk=$(cat /tmp/installdisk)
else
for blockdev in $(ls /sys/class/block/); do
shortname=$(basename $blockdev)
for blockdev in /sys/class/block/*; do
shortname=$(basename "$blockdev")
if [ "$shortname" != "${shortname%loop*}" ]; then
continue
fi
@@ -62,7 +62,7 @@ else
done
fi
if [ -z "$instdisk" ]; then
if [ ! -z "$sraid"]; then
if [ ! -z "$sraid" ]; then
instdisk=$sraid
elif [ ! -z "$onbdisk" ]; then
instdisk=$onbdisk
@@ -34,8 +34,8 @@ done
if [ -e /tmp/installdisk ]; then
instdisk=$(cat /tmp/installdisk)
else
for blockdev in $(ls /sys/class/block/); do
shortname=$(basename $blockdev)
for blockdev in /sys/class/block/*; do
shortname=$(basename "$blockdev")
if [ "$shortname" != "${shortname%loop*}" ]; then
continue
fi
@@ -62,7 +62,7 @@ else
done
fi
if [ -z "$instdisk" ]; then
if [ ! -z "$sraid"]; then
if [ ! -z "$sraid" ]; then
instdisk=$sraid
elif [ ! -z "$onbdisk" ]; then
instdisk=$onbdisk