diff --git a/pkg/de-p1st-installer/lib/block-device.sh b/pkg/de-p1st-installer/lib/block-device.sh index a16cfdf..b6d8f28 100644 --- a/pkg/de-p1st-installer/lib/block-device.sh +++ b/pkg/de-p1st-installer/lib/block-device.sh @@ -102,4 +102,4 @@ function partition() { return 1 ;; esac -} \ No newline at end of file +} diff --git a/pkg/de-p1st-installer/lib/user-input.sh b/pkg/de-p1st-installer/lib/user-input.sh index d6104e0..c07d83e 100644 --- a/pkg/de-p1st-installer/lib/user-input.sh +++ b/pkg/de-p1st-installer/lib/user-input.sh @@ -16,7 +16,7 @@ function get_text_input { fi done - local -n ptr=$1 + local -n ptr=$1 || return $? if [ -z "$ptr" ]; then # if ptr has no value yet, ask user for input! echo "$2" @@ -48,11 +48,11 @@ function get_single_choice { done - local -n ptr=$1 + local -n ptr=$1 || return $? if [ -z "$ptr" ]; then # if ptr has no value yet, ask user for input! - local -n MENU_OPTIONS=$3 + local -n MENU_OPTIONS=$3 || return $? ptr=$(dialog --stdout --menu "$2" 0 0 0 "${MENU_OPTIONS[@]}") || { echo "Error during menu selection!" exit 1 @@ -79,11 +79,11 @@ function get_multi_choice { done - local -n ptr=$1 + local -n ptr=$1 || return $? if [ -z "$ptr" ]; then # if ptr has no value yet, ask user for input! - local -n MENU_OPTIONS=$3 + local -n MENU_OPTIONS=$3 || return $? TMP1=$(dialog --stdout --checklist "$2" 0 0 0 "${MENU_OPTIONS[@]}") || { echo "Error during menu selection!" exit 1 diff --git a/pkg/de-p1st-installer/lib/util.sh b/pkg/de-p1st-installer/lib/util.sh index 48357eb..c7a3711 100644 --- a/pkg/de-p1st-installer/lib/util.sh +++ b/pkg/de-p1st-installer/lib/util.sh @@ -2,7 +2,7 @@ function newline_to_space() { # Replaces all newlines with spaces # $1: name of variable - local -n ptr=$1 + local -n ptr=$1 || return $? # Replace newlines with spaces # See bash string substitution: https://gist.github.com/JPvRiel/b279524d3e56229a896477cb8082a72b @@ -18,8 +18,8 @@ function newline_separated_to_array() { # $1: name of variable with newline separated list # $2: name of array to store values into - local -n ptr=$1 - local -n ptr2=$2 + local -n ptr=$1 || return $? + local -n ptr2=$2 || return $? # ptr newline separated list. # Store this as array ptr2. readarray -t ptr2 <<<"$ptr" @@ -29,8 +29,8 @@ function space_separated_to_array() { # $1: name of variable with space separated list # $2: name of array to store values into - local -n ptr=$1 - local -n ptr2=$2 + local -n ptr=$1 || return $? + local -n ptr2=$2 || return $? # ptr space separated list. # Store this as array ptr2. # Without newline at last array element: https://unix.stackexchange.com/a/519917/315162 diff --git a/pkg/de-p1st-installer/name-reference-test.sh b/pkg/de-p1st-installer/name-reference-test.sh index f816fdd..3efba7a 100644 --- a/pkg/de-p1st-installer/name-reference-test.sh +++ b/pkg/de-p1st-installer/name-reference-test.sh @@ -18,7 +18,7 @@ function text_input { return 1 fi - local -n ptr=$1 + local -n ptr=$1 || return $? if [ -z "$ptr" ]; then echo "$2" read -r ptr || return $?