From e627c7777b0cc386655ec0d8d5d204fc8827c8f5 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Tue, 1 Nov 2022 13:23:24 +0000 Subject: [PATCH] If XDG vars not yet set, use defaults --- install.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index f2cc2a9..b2a15bf 100755 --- a/install.sh +++ b/install.sh @@ -145,6 +145,16 @@ function pre_setup_tasks () { system_verify "vim" false system_verify "nvim" false system_verify "tmux" false + + # If XDG variables arn't yet set, then configure defaults + if [ -z ${XDG_CONFIG_HOME+x} ]; then + echo -e "${YELLOW_B}XDG_CONFIG_HOME is not yet set. Will use ~/.config${RESET}" + XDG_CONFIG_HOME="${HOME}/.config" + fi + if [ -z ${XDG_DATA_HOME+x} ]; then + echo -e "${YELLOW_B}XDG_DATA_HOME is not yet set. Will use ~/.local/share${RESET}" + XDG_DATA_HOME="${HOME}/.local/share" + fi } # Downloads / updates dotfiles and symlinks them @@ -158,7 +168,9 @@ function setup_dot_files () { git clone --recursive ${DOTFILES_REPO} ${DOTFILES_DIR} else echo -e "${PURPLE}Pulling changes from ${REPO_NAME} into ${DOTFILES_DIR}${RESET}" - cd "${DOTFILES_DIR}" && git pull origin master && git submodule update --recursive + cd "${DOTFILES_DIR}" && \ + git pull origin master && \ + git submodule update --recursive --remote --init fi # If git clone / pull failed, then exit with error