-
-
Save deepak/3495246 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cd into a matching gem directory. Pass a grep compatible | |
# regular expression. If you don't pass anything, it goes | |
# to the root gem directory. | |
cdgem () | |
{ | |
local gempath=$(gem env gemdir)/gems; | |
if [[ $1 == "" ]]; then | |
pushd $gempath; | |
return; | |
fi; | |
local gem=$(ls $gempath | grep $1 | sort | tail -1); | |
if [[ $gem != "" ]]; then | |
pushd $gempath/$gem; | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
forked to replaced cd with pushd