Fix bash syntax error in backup_folder return logic
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 31s
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 31s
The arithmetic test `(( rc == 0 || (rc == 1 && -z "$filtered_output") ))` breaks the bash parser when filtered_output is a multiline string. Split the test so the -z check runs in a [[ ]] context instead.
This commit is contained in:
@@ -415,7 +415,9 @@ backup_folder() {
|
|||||||
if [[ -n "$filtered_output" ]]; then
|
if [[ -n "$filtered_output" ]]; then
|
||||||
log_warn "7z output for '${folder_path}': ${filtered_output}"
|
log_warn "7z output for '${folder_path}': ${filtered_output}"
|
||||||
fi
|
fi
|
||||||
if (( rc == 0 || (rc == 1 && -z "$filtered_output") )); then
|
if (( rc == 0 )); then
|
||||||
|
return 0
|
||||||
|
elif (( rc == 1 )) && [[ -z "$filtered_output" ]]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user