From 8b83c13224b872eaea7e118089f144cf0c61375a Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Mon, 31 Oct 2022 16:32:01 +0000 Subject: [PATCH] Auto-locate dotfile directory --- install.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index a9c4ebd..f2cc2a9 100755 --- a/install.sh +++ b/install.sh @@ -12,9 +12,17 @@ # Licensed under MIT (C) Alicia Sykes 2022 # ###################################################################### +# Set variables for reference +PARAMS=$* # User-specified parameters +CURRENT_DIR=$(cd "$(dirname ${BASH_SOURCE[0]})" && pwd) +SYSTEM_TYPE=$(uname -s) # Get system type - Linux / MacOS (Darwin) +PROMPT_TIMEOUT=15 # When user is prompted for input, skip after x seconds +START_TIME=`date +%s` # Start timer +SRC_DIR=$(dirname ${0}) + # Dotfiles Source Repo and Destination Directory REPO_NAME="${REPO_NAME:-Lissy93/Dotfiles}" -DOTFILES_DIR="${DOTFILES_DIR:-$HOME/Documents/config/dotfiles}" +DOTFILES_DIR="${DOTFILES_DIR:-${SRC_DIR:-$HOME/.dotfiles}}" DOTFILES_REPO="${DOTFILES_REPO:-https://github.com/${REPO_NAME}.git}" # Config Names and Locations @@ -23,13 +31,6 @@ SYMLINK_FILE="${SYMLINK_FILE:-symlinks.yaml}" DOTBOT_DIR="lib/dotbot" DOTBOT_BIN="bin/dotbot" -# Set variables for reference -PARAMS=$* # User-specified parameters -CURRENT_DIR=$(cd "$(dirname ${BASH_SOURCE[0]})" && pwd) -SYSTEM_TYPE=$(uname -s) # Get system type - Linux / MacOS (Darwin) -PROMPT_TIMEOUT=15 # When user is prompted for input, skip after x seconds -START_TIME=`date +%s` # Start timer - # Color Variables CYAN_B='\033[1;96m' YELLOW_B='\033[1;93m'