Skip to content

Commit

Permalink
Merge pull request #29 from snmgian/show-error-when-deleting-gemset
Browse files Browse the repository at this point in the history
displaying an error message when the gemset does not exist
  • Loading branch information
joefiorini committed Sep 14, 2012
2 parents 76e022e + 7ecbae7 commit a3530ad
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libexec/rbenv-gemset-delete
Expand Up @@ -8,5 +8,12 @@ if [ -z "$RBENV_VERSION" ] || [ -z "$RBENV_GEMSET" ]; then
exit 1
fi

rm -rf "$(rbenv prefix "$RBENV_VERSION")/gemsets/$RBENV_GEMSET"
GEMSET_PATH="$(rbenv prefix "$RBENV_VERSION")/gemsets/$RBENV_GEMSET"

if [ ! -d $GEMSET_PATH ]; then
echo "couldn't delete ${RBENV_GEMSET} from ${RBENV_VERSION}. Check if it exists"
exit 1
fi

rm -rf $GEMSET_PATH
echo "deleted ${RBENV_GEMSET} from ${RBENV_VERSION}"

0 comments on commit a3530ad

Please sign in to comment.