Skip to content

Commit

Permalink
Merge pull request #105 from zap-zsh/mamaraddio-patch
Browse files Browse the repository at this point in the history
fix: fix `install.zsh` script
  • Loading branch information
wintermi authored Jan 16, 2023
2 parents 4928ff8 + 3044300 commit 7c3cfe0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions install.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ main() {
[[ $1 == "--branch" || $1 == "-b" && -n $2 ]] && local BRANCH="$2"

# check if ZAP_DIR already exists
[[ -d "$ZAP_DIR" ]] && { echo "Zap is already installed in '$ZAP_DIR'!" && read -q "res?Reinstall Zap? [y/N] "; echo "" }
[[ "$res" == "y" ]] && { echo "Reinstalling Zap..." && rm -rf "$ZAP_DIR" } || return 0
[[ -d "$ZAP_DIR" ]] && {
echo "Zap is already installed in '$ZAP_DIR'!"
read -q "res?Reinstall Zap? [y/N] "
echo ""
[[ "$res" == "y" ]] && {
echo "Reinstalling Zap..."
rm -rf "$ZAP_DIR"
} || return 0
}

git clone -b "${BRANCH:-master}" https://github.com/zap-zsh/zap.git "$ZAP_DIR" > /dev/null 2>&1 || { echo "❌ Failed to install Zap" && return 2 }
mkdir -p "$ZAP_DIR/plugins"
Expand Down

0 comments on commit 7c3cfe0

Please sign in to comment.