Last active
January 24, 2017 06:17
-
-
Save kjirou/8eda217ade5797452e222a8b1be2b614 to your computer and use it in GitHub Desktop.
関連キーワードが存在するファイル一覧を git grep で抽出するシェルスクリプト
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/sh | |
PROJECT_ROOT=$(pwd) | |
#SCRIPT_ROOT=$(cd $(dirname $0) && pwd) | |
#PROJECT_ROOT="$SCRIPT_ROOT/.." | |
KEYWORDS='' | |
KEYWORDS=$KEYWORDS'foo|bar|baz' | |
grep_regex='('$KEYWORDS')' | |
grep_result=$(git grep -El "($grep_regex)" $PROJECT_ROOT/app/) | |
echo "$grep_result" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment