Skip to content

Commit b8b50bf

Browse files
authored
Merge pull request #255 from punkch/bugfix/scripts-early-exit-on-linux
fix(scripts): early exit in scripts due to post increment ((var++))
2 parents f7f9ce9 + 3899739 commit b8b50bf

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
@@ -533,7 +533,7 @@ process_conditionals() {
533533
should_include=false
534534
fi
535535

536-
((nesting_level++))
536+
((nesting_level++)) || true
537537
continue
538538
fi
539539

@@ -568,7 +568,7 @@ process_conditionals() {
568568
should_include=false
569569
fi
570570

571-
((nesting_level++))
571+
((nesting_level++)) || true
572572
continue
573573
fi
574574

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)