Skip to content

Commit 3899739

Browse files
committed
fix: early exit in scripts due to post increment ((var++))
1 parent 2ecab6b commit 3899739

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

scripts/base-install.sh

100644100755
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ download_all_files() {
217217
[[ -d "$dir_path" ]] || mkdir -p "$dir_path"
218218

219219
if download_file "$file_path" "$dest_file"; then
220-
((file_count++))
220+
((file_count++)) || true
221221
print_verbose " Downloaded: ${file_path}"
222222
else
223223
print_verbose " Failed to download: ${file_path}"
@@ -448,7 +448,7 @@ full_update() {
448448
local dir_path=$(dirname "$dest_file")
449449
[[ -d "$dir_path" ]] || mkdir -p "$dir_path"
450450
if download_file "$file_path" "$dest_file"; then
451-
((file_count++))
451+
((file_count++)) || true
452452
print_verbose " Downloaded: ${file_path}"
453453
fi
454454
fi
@@ -469,7 +469,7 @@ full_update() {
469469
local dir_path=$(dirname "$dest_file")
470470
[[ -d "$dir_path" ]] || mkdir -p "$dir_path"
471471
if download_file "$file_path" "$dest_file"; then
472-
((file_count++))
472+
((file_count++)) || true
473473
print_verbose " Downloaded: ${file_path}"
474474
fi
475475
fi
@@ -532,7 +532,7 @@ overwrite_profile() {
532532
[[ -d "$dir_path" ]] || mkdir -p "$dir_path"
533533

534534
if download_file "$file_path" "$dest_file"; then
535-
((file_count++))
535+
((file_count++)) || true
536536
print_verbose " Downloaded: ${file_path}"
537537
fi
538538
fi
@@ -563,7 +563,7 @@ overwrite_scripts() {
563563
[[ -d "$dir_path" ]] || mkdir -p "$dir_path"
564564

565565
if download_file "$file_path" "$dest_file"; then
566-
((file_count++))
566+
((file_count++)) || true
567567
print_verbose " Downloaded: ${file_path}"
568568
fi
569569
fi

scripts/common-functions.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ process_conditionals() {
515515
should_include=false
516516
fi
517517
518-
((nesting_level++))
518+
((nesting_level++)) || true
519519
continue
520520
fi
521521
@@ -550,7 +550,7 @@ process_conditionals() {
550550
should_include=false
551551
fi
552552
553-
((nesting_level++))
553+
((nesting_level++)) || true
554554
continue
555555
fi
556556

scripts/create-profile.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ select_inheritance() {
130130
local index=2
131131
for profile in "${profiles[@]}"; do
132132
echo " $index) $profile"
133-
((index++))
133+
((index++)) || true
134134
done
135135

136136
echo ""
@@ -194,7 +194,7 @@ select_copy_source() {
194194
local index=2
195195
for profile in "${profiles[@]}"; do
196196
echo " $index) $profile"
197-
((index++))
197+
((index++)) || true
198198
done
199199

200200
echo ""

0 commit comments

Comments
 (0)