Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Runs a shell command (contained in $argv[1]) in the base of every | ||
* application and library contained in the current git checkout. | ||
*/ | ||
|
||
function horde_get_base_dirs() | ||
{ | ||
$basedirs = array( | ||
dirname(__FILE__) . '/../', | ||
dirname(__FILE__) . '/../../' | ||
); | ||
|
||
$out = array(); | ||
|
||
foreach ($basedirs as $base) { | ||
foreach (new DirectoryIterator($base) as $val) { | ||
if ($val->isDir() && | ||
file_exists($val->getPathname() . '/package.xml')) { | ||
$out[] = realpath($val->getPathname()); | ||
} | ||
} | ||
} | ||
|
||
return $out; | ||
} | ||
|
||
foreach (horde_get_base_dirs() as $val) { | ||
chdir($val); | ||
system($argv[1]); | ||
} |