Skip to content

Instantly share code, notes, and snippets.

@qinshulei
Created December 7, 2015 12:32
Show Gist options
  • Select an option

  • Save qinshulei/8b3409f57d5e4b8019a7 to your computer and use it in GitHub Desktop.

Select an option

Save qinshulei/8b3409f57d5e4b8019a7 to your computer and use it in GitHub Desktop.
repo jump contains repogo and repofzf two functions
#!/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