From 965552b8e5a572bb4d15132655a3cae9913fda8e Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Tue, 27 Dec 2016 23:22:38 +0000 Subject: [PATCH] Reorganize install.sh slightly --- install.sh | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/install.sh b/install.sh index 622682a..a7b502c 100755 --- a/install.sh +++ b/install.sh @@ -30,6 +30,21 @@ SYMLINKS=( ) LOAD_FILES=(profile zshrc) + +# +# Initial Setup +# + +if [ -n "${BASH_SOURCE[0]}" ] && [ -f "${BASH_SOURCE[0]}" ] ; then + ROOT_PATH=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +elif [ -n "$0" ] && [ -f "$0" ]; then + ROOT_PATH=$(cd "$(dirname "$0")" && pwd) +else + echo "[ERROR] Can't determine dotfiles' root path." + exit 1 +fi + + # # Main Functions # @@ -97,20 +112,6 @@ install_dokku() { } -# -# Initial Setup -# - -if [ -n "${BASH_SOURCE[0]}" ] && [ -f "${BASH_SOURCE[0]}" ] ; then - ROOT_PATH=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -elif [ -n "$0" ] && [ -f "$0" ]; then - ROOT_PATH=$(cd "$(dirname "$0")" && pwd) -else - echo "[ERROR] Can't determine dotfiles' root path." - exit 1 -fi - - # # Helper functions #