Last active
March 21, 2018 09:13
-
-
Save dessibelle/b33fd83239052b773277deb055d41ee8 to your computer and use it in GitHub Desktop.
Open git grep matches in Sublime
This file contains 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
#!/usr/bin/env bash | |
files=`git grep --name-only ${1:+"$@"} | awk '{printf "%s ",$0} END {print ""}'` | |
if [[ ! -z "${files// }" ]] ; then | |
subl . && subl $files | |
else | |
echo "No matches." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment