From 06c7c2349a4e0263ed8efec50f5c2270042277dd Mon Sep 17 00:00:00 2001 From: ge Date: Sun, 15 May 2022 02:10:26 +0300 Subject: [PATCH] feat: Add helper variable for optimization --- src/lib/source.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/source.sh b/src/lib/source.sh index 8d96804..4e61598 100644 --- a/src/lib/source.sh +++ b/src/lib/source.sh @@ -37,7 +37,7 @@ validate_sources() { } validate_targets() { - # Check targets array and set __main_target variable. + # Check targets array and set __main_target and __main_target_path # # Usage: validate_targets ARRAY @@ -71,9 +71,9 @@ validate_targets() { # Fail if __main_target's path is not a directory parse_uri "$__main_target" if [ -d "$path" ]; then - __main_target="$path" + __main_target_path="$path" else - echo "Error: Path $path in $__main_target" \ + echo "Error: Path '$path' from URI '$__main_target'" \ "is not directory or does not exists" >&2 exit 1 fi @@ -120,4 +120,5 @@ is_function_set() { # Usage: is_function_set FUNCTION declare -F -- "$1" > /dev/null + return "$?" }