Skip to content

Commit 807c4ce

Browse files
committed
[fix] : Fixed SC2086
1 parent bee39eb commit 807c4ce

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

tools/alteriso-info.sh

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,29 +85,20 @@ while true; do
8585
esac
8686
done
8787

88-
variable_list=(
89-
"arch"
90-
"boot_splash"
91-
"channel_name"
92-
"iso_publisher"
93-
"kernel"
94-
"iso_application"
95-
"password"
96-
"username"
97-
"iso_version"
98-
)
88+
variable_list=( "arch" "boot_splash" "channel_name" "iso_publisher" "kernel" "iso_application" "password" "username" "iso_version")
9989

90+
error=false
10091
for var in "${variable_list[@]}"; do
101-
if [[ -z "$(eval echo '$'${var})" ]]; then
92+
if [[ -z "$(eval echo "\$${var}")" ]]; then
10293
echo "${var} is empty" >&2
103-
exit 1
94+
error=true
10495
fi
10596
done
106-
97+
[[ "${error}" = true ]] && exit 1
98+
unset error
10799

108100
# Get kernel info
109-
eval $(bash "${tools_dir}/kernel.sh" -s -c "${channel_name}" -a "${arch}" get "${kernel}")
110-
101+
eval "$(bash "${tools_dir}/kernel.sh" -s -c "${channel_name}" -a "${arch}" get "${kernel}")"
111102

112103
echo "Developer : ${iso_publisher}"
113104
echo "OS Name : ${iso_application}"

0 commit comments

Comments
 (0)