Created
April 8, 2014 06:58
-
-
Save ursenzler/10098372 to your computer and use it in GitHub Desktop.
executes a command on all Appccelerate repos
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
function ExecuteOnRepos([string]$reposPath, [string]$command, [string]$arguments) | |
{ | |
$folders = Get-ChildItem $reposPath | ?{ $_.PSIsContainer } | Select-Object FullName | |
foreach($folder in $folders) | |
{ | |
cd $folder.FullName | |
$gitFolder = $folder.FullName + "\.git" | |
if (Test-Path $gitFolder) | |
{ | |
write-host executing $command $arguments in $folder.FullName | |
& $command $arguments | |
} | |
else | |
{ | |
write-host skipping because folder $folder.FullName is no git repository | |
} | |
cd .. | |
"" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment