Created
July 9, 2015 11:55
-
-
Save veb/2721b519f689033a20ef to your computer and use it in GitHub Desktop.
Highlight Git repos in Finder (for OSX)
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
set theSearchPath to "/Users/<username>" | |
set theResults to do shell script "find " & quoted form of theSearchPath & " -name .git ! -perm -g+r,u+r,o+r -prune" | |
repeat with i from 1 to (count paragraphs of theResults) | |
set theResult to paragraph i of theResults | |
set theParentPath to text 1 through ((length of theResult) - 5) of theResult | |
set theParentAlias to POSIX file (theParentPath) as alias | |
tell application "Finder" | |
set label index of theParentAlias to 6 | |
-- Set the last value of the previous line corresponding to label color desired | |
-- 0 (no color) | |
-- 1 (orange) | |
-- 2 (red) | |
-- 3 (yellow) | |
-- 4 (blue) | |
-- 5 (purple) | |
-- 6 (green) | |
-- 7 (gray) | |
end tell | |
end repeat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment