LoginSignup
0
0

More than 5 years have passed since last update.

ghqユーザー向け。同じorganization配下のリポジトリを横断検索するスクリプト

Last updated at Posted at 2016-10-07

ghqを使っている人向けの、同じorganization配下にあるリポジトリを横断検索するためのスクリプトを書きました。
僕みたいにマイクロサービスでつらい思いしている方などはどうぞ使ってください。

~/.zshrc
rgrep() {
  for repo in $(ghq list); do
    # organization_nameを書き換えてください
    if [[ $repo =~ .*organizaiton_name.* ]]; then
      # リポジトリ名を色をつけて表示
      printf '\e[1;34m%-6s\e[m' $repo
      echo
      (cd $(ghq root)/$repo; git grep $1)
      echo
    fi
  done
}
0
0
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
0
0