Created
December 7, 2015 12:32
-
-
Save qinshulei/8b3409f57d5e4b8019a7 to your computer and use it in GitHub Desktop.
repo jump contains repogo and repofzf two functions
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
| #!/bin/bash | |
| function repogo(){ | |
| project_name=$1 | |
| out=$(repo list | grep "${project_name}") | |
| if [ -n ${out} ];then | |
| project_path=$(echo "${out}" | awk '{print $1}') | |
| echo "cd ${project_path}" | |
| cd "${project_path}" | |
| fi | |
| } | |
| function repofzf(){ | |
| project_name=$1 | |
| out=$(repo list | fzf -q "${project_name}") | |
| if [ -n ${out} ];then | |
| project_path=$(echo "${out}" | awk '{print $1}') | |
| echo "cd ${project_path}" | |
| cd "${project_path}" | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment