Improve clone-repos.ps1

This commit is contained in:
Markus Fleschutz
2021-06-28 21:24:10 +02:00
parent 8cd8bfc1cd
commit 0cfa90aabc
2 changed files with 4 additions and 3 deletions

View File

@ -19,15 +19,16 @@ try {
[int]$Count = 0
foreach($Row in $Table) {
$AppName = $Row.AppName
$FolderName = $Row.FolderName
$BranchName = $Row.BranchName
$URL = $Row.URL
if (test-path "$ParentDir/$FolderName" -pathType container) {
"📂$FolderName exists already, skipping..."
"📂$FolderName for $AppName exists already, skipping..."
continue
}
"🢃 Cloning 📂$FolderName from $URL, $BranchName branch..."
"🢃 Cloning $AppName into 📂$FolderName, $BranchName branch..."
& git clone --branch "$BranchName" --recurse-submodules "$URL" "$ParentDir/$FolderName"
if ($lastExitCode -ne "0") { throw "'git clone $URL' failed" }
$Count++