From 9dd10834e9480196b3fc0be1cd595a3ced7a4f6d Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Date: Tue, 5 Jun 2012 20:43:38 +0530 Subject: [PATCH] Fix cleanup giving an error on no bundles. Where there are no bundles, or the bundle directory does not exist, the `bundle-cleanup` command gives out an error. This fix is to make it give a saner message instead. --- antigen.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/antigen.zsh b/antigen.zsh index 0b03e70..5b87f4e 100644 --- a/antigen.zsh +++ b/antigen.zsh @@ -136,6 +136,12 @@ bundle-install! () { bundle-cleanup () { + if [[ ! -d "$ANTIGEN_BUNDLE_DIR" || \ + "$(ls "$ANTIGEN_BUNDLE_DIR/" | wc -l)" == 0 ]]; then + echo "You don't have any bundles." + return 0 + fi + # Find directores in ANTIGEN_BUNDLE_DIR, that are not in the bundles record. local unidentified_bundles="$(comm -13 \ <(echo-non-empty "$bundles" | awk '{print $1}' | sort) \ -- 2.0.0