From d9e42c210f1d2f6e1a6120dbc929329d984fbfaf Mon Sep 17 00:00:00 2001 From: Kitty Fangs Date: Mon, 20 May 2024 05:07:43 +0000 Subject: [PATCH] fix: guarded homeshick install in an if statement --- init.sh | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/init.sh b/init.sh index af8ec23..627b8d5 100644 --- a/init.sh +++ b/init.sh @@ -15,21 +15,24 @@ for app in git curl; do done ## Install homeshick -git clone https://github.com/andsens/homeshick.git "$HOME/.homesick/repos/homeshick" -# shellcheck source=/dev/null -source "$HOME/.homesick/repos/homeshick/homeshick.sh" -source $HOME/.homesick/repos/homeshick/completions/homeshick-completion.bash +if [[ ! -d $HOME/.homesick ]]; then + git clone https://github.com/andsens/homeshick.git "$HOME/.homesick/repos/homeshick" + # shellcheck source=/dev/null + source "$HOME/.homesick/repos/homeshick/homeshick.sh" + source $HOME/.homesick/repos/homeshick/completions/homeshick-completion.bash -## clone home, then set it to ssh afterwards -## This means we need our keys before we can make further actions - disable the ssh behavior for now -homeshick --batch clone https://stash.firekitten.net/kittyfangs/dotfiles.git -## git -C "$HOME/.homesick/repos/dotfiles" remote set-url origin git@stash.firekitten.net:kittyfangs/dotfiles + ## clone home, then set it to ssh afterwards + ## This means we need our keys before we can make further actions - disable the ssh behavior for now + homeshick --batch clone https://stash.firekitten.net/kittyfangs/dotfiles.git + ## git -C "$HOME/.homesick/repos/dotfiles" remote set-url origin git@stash.firekitten.net:kittyfangs/dotfiles -## Lets get the powerhsell version since we are initing in bash -homeshick --batch clone https://github.com/KitKat31337/homepsick.git + ## Lets get the powerhsell version since we are initing in bash + homeshick --batch clone https://github.com/KitKat31337/homepsick.git + + ## Link everything + homeshick link --force +fi -## Link everything -homeshick link --force if ! command -v brew &>/dev/null; then /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"