diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index eb301139..d1dacaab 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -28,14 +28,14 @@ check_git_root(){ fi } -get_script_path(){ +check_script_path(){ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) echo "SCRIPT_DIR: ${SCRIPT_DIR}" } check_shell check_git_root -get_script_path +check_script_path ################# standard init ################# diff --git a/scripts/functions.sh b/scripts/functions.sh index e90b653c..307133bc 100755 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -1,14 +1,11 @@ #!/bin/bash # shellcheck disable=SC1091,SC2034 -RED='\033[1;31m' -BLUE='\033[1;36m' -PURPLE='\033[1;35m' ORANGE='\033[0;33m' NC='\033[0m' # No Color check_shell(){ - [ -n "$BASH_VERSION" ] && return + [ -n "${BASH_VERSION}" ] && return echo -e "${ORANGE}WARNING: These scripts are ONLY tested in a bash shell${NC}" sleep "${SLEEP_SECONDS:-8}" } @@ -27,7 +24,7 @@ check_git_root(){ fi } -get_script_path(){ +check_script_path(){ [ -n "${SCRIPT_DIR}" ] && return SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) @@ -70,7 +67,7 @@ is_sourced(){ check_shell check_git_root -get_script_path +check_script_path source_library setup_bin_path diff --git a/scripts/reverse_tunnel/reverse_tunnel.sh b/scripts/reverse_tunnel/reverse_tunnel.sh index 37b6e9b0..6e28e233 100755 --- a/scripts/reverse_tunnel/reverse_tunnel.sh +++ b/scripts/reverse_tunnel/reverse_tunnel.sh @@ -81,7 +81,7 @@ kludge_install_user(){ } kludge_install_app(){ - SCRIPT_DIR=$(get_script_path) + SCRIPT_DIR=$(check_script_path) [ "${SCRIPT_DIR}" == "/usr/local/bin" ] && return # install script and env into ${APP_PATH} @@ -142,7 +142,7 @@ var_unset(){ echo "${1} env var is NOT set" } -get_script_path(){ +check_script_path(){ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) echo "${SCRIPT_DIR}" }