Skip to content

Commit

Permalink
Auto-prune shifted or removed project gemsets from the gemset list,
Browse files Browse the repository at this point in the history
instead of forcing a manual cleanup! Closes #72.
  • Loading branch information
jf committed Aug 24, 2014
1 parent 8712b26 commit d134572
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libexec/rbenv-gemset-list
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ for version in "$RBENV_ROOT"/versions/*; do
for gemset in "${gemsets[@]}"; do
if [[ $gemset =~ $project_gemset ]]; then
location=${gemset##*/}
echo -n " ${location//__//}"
[[ -e $gemset ]] && echo
[[ ! -e $gemset ]] && echo " (shifted or removed)"
if [[ -e $gemset ]]; then
echo " ${location//__//}"
else
rm "$gemset"
fi
else
echo " ${gemset##*/}"
fi
Expand Down

0 comments on commit d134572

Please sign in to comment.