Skip to content

Commit

Permalink
add existence assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
thornjad committed Mar 8, 2023
1 parent 4f01656 commit 4bae5ba
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions zpico.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,10 @@ _zpico_selfupdate() {
fi
}

_zpico_clean() {
read "choice?Remove all downloaded plugins [y/N]? "
if [[ ${${choice:0:1}:l} = "y" ]]; then
echo "Removing all downloaded plugins... "
find ${ZP_PLUGIN_HOME} -type d -maxdepth 1 -exec test -e '{}/.git' ';' -print0 | xargs -0tI {} rm -rf {}
_zpico_assert_exists() {
if [[ ! -d "${ZP_PLUGIN_HOME}/${1:t}" ]]; then
echo "Package ${1} not found"
return 1
fi
}

Expand Down

0 comments on commit 4bae5ba

Please sign in to comment.