Last active
February 23, 2016 19:56
-
-
Save itelo/dc16e0e5c0b495734a0d to your computer and use it in GitHub Desktop.
github/gitlab func to cd
This file contains 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
github() { | |
path=$1 | |
count=0 | |
shift | |
case $path in | |
*) pathToList=$(ls -d ~/Documentos/github/* | cut -f6 -d '/') | |
pathToDir=($(ls -d ~/Documentos/github/*)) | |
for i in ${pathToList[*]}; | |
do | |
echo $count')' $i | |
let "count = $count + 1" | |
done | |
read -r path | |
cd ${pathToDir[$path]} | |
;; | |
esac | |
} | |
gitlab() { | |
path=$1 | |
count=0 | |
shift | |
case $path in | |
*) pathToList=$(ls -d ~/Documentos/gitlab/* | cut -f6 -d '/') | |
pathToDir=($(ls -d ~/Documentos/gitlab/*)) | |
for i in ${pathToList[*]}; | |
do | |
echo $count')' $i | |
let "count = $count + 1" | |
done | |
read -r path | |
cd ${pathToDir[$path]} | |
;; | |
esac | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment