LoginSignup
3
1

More than 5 years have passed since last update.

ghqとpecoをつかって、bashでもrepository管理するスクリプト

Posted at

概要

ghqを使って、repositoryを管理していると、インタラクティブに管理しているrepositoryにアクセスしたくなる。当然pecoを使ってやりたいのだけれど、だいたいzshのスクリプトが出てくる。「ぶっちゃけzshよりも、もうbashでよくね?」派なので、bashでもghqをpecoれるのを書いた。

source

これをbashrcに書いて、source ~/.bashrcしてください。repoと打てばハッピーになれます。

function repo {
    pushd $HOME/.ghq
    local dir="$( ls -1d */*/* | peco )"
    if [ ! -z "$dir" ] ; then
        cd "$dir"
    else
        popd
    fi
}
3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1