Skip to content

Commit

Permalink
Align releas-v1 to tag 1.1.4 (#155)
Browse files Browse the repository at this point in the history
* docs: make it more obvious the image is a video link

* feat: update README (#150)

* feat: update README

* fix: update README with the new video thumbnail

* fix: update README with updated uninstall text

* fix: unshallow clone for plugin checkout (#153)

* fix: unshallow clone for plugin checkout

fixes #151

* refactor: address PR comments

---------

Co-authored-by: Matthew Winter <[email protected]>
Co-authored-by: Christian Chiarulli <[email protected]>
Co-authored-by: António Peixe <[email protected]>
  • Loading branch information
4 people authored May 15, 2023
1 parent 825c739 commit a834b5c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,15 @@ plug "$HOME/.config/zsh/aliases.zsh"
plug "$HOME/.config/zsh/exports.zsh"
```

By default `Zap` when installing a plugin will clone a GitHub repository using a HTTPS web URL, if you require to be able to install from a private GitHub or from a different git server (for example GitLab) you can provide a different URL prefix to be used. For example, using a password-protected SSH key:
By default `Zap` when installing a plugin will clone a GitHub repository using a HTTPS web URL, if you require to be able to install from a private GitHub or from a different git server (for example GitLab) you can provide a different URL prefix to be used. For example:

```zsh
# Your ZSHRC file
...

# Example globally set Zap to git clone using an SSH key
export ZAP_GIT_PREFIX='[email protected]:'
# Example globally seting the prefix for Zap to git clone using an SSH key
export ZAP_GIT_PREFIX="[email protected]:"
plug "zap-zsh/private-repo"

# Example git clone using GitLab for a single plugin
ZAP_GIT_PREFIX='https://gitlab.com/' plug "user/repo"

...
ZAP_GIT_PREFIX="https://gitlab.com/" plug "user/repo"
```

It is possible to call `plug` in any interactive shell session to source a file or to download and source a plugin for that particular session.
Expand Down Expand Up @@ -127,8 +122,16 @@ Zap provided commands for updating and cleaning up plugins

## Uninstall

To uninstall Zap, when currently active, execute the following:

```zsh
rm -rf "$ZAP_DIR"
```

When not currently active, execute the following:

```zsh
rm -rf ~/.local/share/zap
rm -rf "${XDG_DATA_HOME:-$HOME/.local/share}/zap"
```

## Notes
Expand All @@ -137,7 +140,7 @@ For sourcing local files use `$HOME` instead of `~` when giving a full path to t

---

[![zap thumbnail](https://user-images.githubusercontent.com/29136904/237558142-b6201b3f-bf85-4866-95f3-df275cc94759.png)](https://www.youtube.com/watch?v=LhDMw6n3GI4)
[![zap thumbnail](https://user-images.githubusercontent.com/29136904/238183118-943e3f25-5198-45a5-a22e-45a3a27db11d.png)](https://www.youtube.com/watch?v=LhDMw6n3GI4)

<!----------------------------------------------------------------------------->

Expand Down
5 changes: 4 additions & 1 deletion zap.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ function plug() {
git clone --depth 1 "${ZAP_GIT_PREFIX:-"https://github.com/"}${plugin}.git" "$plugin_dir" > /dev/null 2>&1 || { echo -e "\e[1A\e[K❌ Failed to clone $plugin_name"; return 12 }
echo -e "\e[1A\e[K⚡ Zap installed $plugin_name"
fi
[[ -n "$git_ref" ]] && { git -C "$plugin_dir" checkout "$git_ref" > /dev/null 2>&1 || { echo "❌ Failed to checkout $git_ref"; return 13 }}
[[ -n "$git_ref" ]] && {
git -C "$plugin_dir" pull --unshallow > /dev/null 2>&1
git -C "$plugin_dir" checkout "$git_ref" > /dev/null 2>&1 || { echo "❌ Failed to checkout $git_ref"; return 13 }
}
_try_source && { ZAP_INSTALLED_PLUGINS+="$plugin_name" && return 0 } || echo "$plugin_name not activated" && return 1
}

Expand Down

0 comments on commit a834b5c

Please sign in to comment.