Skip to content

Commit 83c5161

Browse files
committed
inject-cmdline-to-template.sh: use -e again
Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
1 parent eabb683 commit 83c5161

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hack/inject-cmdline-to-template.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# 6. inject the kernel and initrd location, digest, and cmdline to the template
1010
# 7. output kernel_location, kernel_digest, cmdline, initrd_location, initrd_digest
1111

12-
set -u -o pipefail
12+
set -eu -o pipefail
1313

1414
template="$1"
1515
appending_options="$2"
@@ -45,6 +45,7 @@ while IFS= read -r line; do arr+=("${line}"); done <<<"${parsed}"
4545
readonly locations=("${arr[@]}")
4646
for ((i = 0; i < ${#locations[@]}; i++)); do
4747
[[ ${locations[i]} != "null" ]] || continue
48+
# shellcheck disable=SC2310
4849
if check_location "${locations[i]}"; then
4950
location=${locations[i]}
5051
index=${i}
@@ -85,6 +86,7 @@ initrd_location="${location_dirname}/${initrd_basename}"
8586
function inject_to() {
8687
# shellcheck disable=SC2034
8788
local template=$1 arch=$2 index=$3 key=$4 location=$5 digest=$6 cmdline=${7:-} fields=() IFS=,
89+
# shellcheck disable=SC2310
8890
check_location "${location}" || return 0
8991
for field_name in location digest cmdline; do
9092
[[ -z ${!field_name} ]] || fields+=("\"${field_name}\": \"${!field_name}\"")

0 commit comments

Comments
 (0)