Last active
August 29, 2015 14:16
-
-
Save dsueiro/8bb2922f6ec30277e791 to your computer and use it in GitHub Desktop.
Looking for a certain module on a folder containing bare repositories with Magentos
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
| <?php | |
| if (count($argv) != 2) { | |
| die("Usage:\n\tphp {$argv[0]} scope/module/folder\nExample:\tphp {$argv[0]} local/SemExpert/Oca # no bar at the end"); | |
| } | |
| foreach(glob('*.git') as $dir) { | |
| if (!chdir($dir)) { | |
| continue; | |
| } | |
| $cmd = "git ls-tree -r master app/code/{$argv[1]}/etc/config.xml"; | |
| #echo "$cmd\n"; | |
| $result = exec($cmd); | |
| if (!empty($result)) { | |
| echo "$dir\n"; | |
| $parts = preg_split("/\s+/ ", $result); | |
| $cmd2 = "git cat-file blob {$parts[2]} | grep \<version\>"; | |
| #echo "$cmd2\n"; | |
| echo exec($cmd2) . "\n"; | |
| } | |
| chdir('..'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment