From 383c3ab89dca3a25dece6bd0d8aa0e71eec178e4 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 11 Aug 2019 01:32:32 +0300 Subject: shellcheck fixes --- src/db.sh | 4 ++-- src/os.sh | 2 +- src/vars.sh | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/db.sh b/src/db.sh index 2d3dd1e..bf19a81 100644 --- a/src/db.sh +++ b/src/db.sh @@ -16,12 +16,12 @@ update_shared_dir() { local new_shared_dir new_shared_dir="$( traverse_path --exist --directory -- "$1" )" - [ new_shared_dir = / ] || new_shared_dir="$new_shared_dir/" + [ "$new_shared_dir" = / ] || new_shared_dir="$new_shared_dir/" [ "$db_path" = "$shared_root_dir$default_db_name" ] \ && db_path="$new_shared_dir$default_db_name" - shared_dir="$new_shared_dir" + shared_root_dir="$new_shared_dir" } # Database maintenance diff --git a/src/os.sh b/src/os.sh index 2a532cd..f9ab7ff 100644 --- a/src/os.sh +++ b/src/os.sh @@ -14,8 +14,8 @@ is_cygwin() { check_symlinks_enabled_cygwin() { case "${CYGWIN-}" in - *winsymlinks:native*) ;; *winsymlinks:nativestrict*) ;; + *winsymlinks:native*) ;; *) dump "native Windows symlinks aren't enabled in Cygwin" >&2 diff --git a/src/vars.sh b/src/vars.sh index 2bac2ff..f989b0a 100644 --- a/src/vars.sh +++ b/src/vars.sh @@ -7,6 +7,8 @@ declare -A cached_paths +readonly root_var_name='CONFIG_LINKS_ROOT' + resolve_variable() { if [ "$#" -ne 1 ]; then echo "usage: ${FUNCNAME[0]} VAR_NAME" >&2 @@ -42,7 +44,6 @@ cache_variable() { done } -readonly root_var_name='CONFIG_LINKS_ROOT' readonly var_name_regex='%\([_[:alpha:]][_[:alnum:]]*\)%' extract_variable_name() { -- cgit v1.2.3