mirror of
https://github.com/Lissy93/dotfiles.git
synced 2025-02-17 23:30:47 +01:00
Adds check if ZSH is default to install script
This commit is contained in:
parent
5b3061b2cd
commit
e8ec5c456e
13
install.sh
13
install.sh
@ -85,6 +85,15 @@ if [ "$system_type" = "Darwin" ] && ! command_exists brew; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If ZSH not the default shell, ask user if they'd like to set it
|
||||||
|
if [[ $SHELL != *"zsh"* ]] && command_exists zsh; then
|
||||||
|
read -p "Would you like to set ZSH as your default shell? (y/N)" -n 1 -r
|
||||||
|
echo
|
||||||
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||||
|
chsh -s $(which zsh) $USER
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Download / update dotfiles repo with git
|
# Download / update dotfiles repo with git
|
||||||
if [[ ! -d "$DOTFILES_DIR" ]]
|
if [[ ! -d "$DOTFILES_DIR" ]]
|
||||||
then
|
then
|
||||||
@ -93,7 +102,7 @@ then
|
|||||||
git clone --recursive ${REPO_PATH} ${DOTFILES_DIR}
|
git clone --recursive ${REPO_PATH} ${DOTFILES_DIR}
|
||||||
else
|
else
|
||||||
echo -e "Pulling changes from ${REPO_NAME} into ${DOTFILES_DIR}"
|
echo -e "Pulling changes from ${REPO_NAME} into ${DOTFILES_DIR}"
|
||||||
cd "${DOTFILES_DIR}" && git pull
|
cd "${DOTFILES_DIR}" && git pull && git submodule update --recursive
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If git clone / pull failed, then exit with error
|
# If git clone / pull failed, then exit with error
|
||||||
@ -115,7 +124,7 @@ fi
|
|||||||
cd "${DOTFILES_DIR}"
|
cd "${DOTFILES_DIR}"
|
||||||
git -C "${DOTBOT_DIR}" submodule sync --quiet --recursive
|
git -C "${DOTBOT_DIR}" submodule sync --quiet --recursive
|
||||||
git submodule update --init --recursive "${DOTBOT_DIR}"
|
git submodule update --init --recursive "${DOTBOT_DIR}"
|
||||||
|
chmod +x dotbot/bin/dotbot
|
||||||
"${DOTFILES_DIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${DOTFILES_DIR}" -c "${CONFIG}" "${@}"
|
"${DOTFILES_DIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${DOTFILES_DIR}" -c "${CONFIG}" "${@}"
|
||||||
|
|
||||||
# Update source to ZSH entry point
|
# Update source to ZSH entry point
|
||||||
|
Loading…
Reference in New Issue
Block a user