Improve output of clone-repos.ps1

This commit is contained in:
Markus Fleschutz 2021-04-21 11:59:13 +02:00
parent ee93d55dc1
commit 0317186fc7

View File

@ -21,13 +21,13 @@ try {
[int]$Count = 0 [int]$Count = 0
foreach($Row in $Table) { foreach($Row in $Table) {
$URL = $Row.URL $URL = $Row.URL
$Directory = $Row.Directory $DirName = $Row.Directory
if (Test-Path "$ParentDir/$Directory") { if (test-path "$ParentDir/$DirName" -pathType container) {
"Skipping 📂$Directory (exists already) ..." "Skipping 📂$DirName - it exists already ..."
continue continue
} }
"⏳ Cloning $URL..." "⏳ Cloning $URL to 📂$DirName..."
& git clone --recurse-submodules "$URL" "$ParentDir/$Directory" & git clone --recurse-submodules "$URL" "$ParentDir/$DirName"
if ($lastExitCode -ne "0") { throw "'git clone $URL' failed" } if ($lastExitCode -ne "0") { throw "'git clone $URL' failed" }
$Count++ $Count++
} }