mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-24 10:58:16 +02:00
Update clone-repos.ps1
This commit is contained in:
parent
e1150b70e0
commit
bd6024eb1d
@ -22,13 +22,13 @@ try {
|
|||||||
& git --version
|
& git --version
|
||||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||||
|
|
||||||
Write-Host "⏳ (2) Loading database table from Data/git-repos.csv... " -noNewline
|
Write-Host "⏳ (2) Loading data from Data/git-repos.csv... " -noNewline
|
||||||
$Table = Import-CSV "$PSScriptRoot/../Data/git-repos.csv"
|
$Table = Import-CSV "$PSScriptRoot/../Data/git-repos.csv"
|
||||||
$NumEntries = $Table.count
|
$NumEntries = $Table.count
|
||||||
Write-Host "$NumEntries entries found"
|
Write-Host "$NumEntries Git repositories"
|
||||||
|
|
||||||
$ParentFolderName = (Get-Item "$FolderPath").Name
|
$ParentFolderName = (Get-Item "$FolderPath").Name
|
||||||
"⏳ (3) Checking target folder 📂$ParentFolderName..."
|
Write-Host "⏳ (3) Checking target folder... 📂$ParentFolderName"
|
||||||
if (-not(Test-Path "$FolderPath" -pathType container)) { throw "Can't access directory: $FolderPath" }
|
if (-not(Test-Path "$FolderPath" -pathType container)) { throw "Can't access directory: $FolderPath" }
|
||||||
|
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ try {
|
|||||||
$Step++
|
$Step++
|
||||||
|
|
||||||
if (Test-Path "$FolderPath/$FolderName" -pathType container) {
|
if (Test-Path "$FolderPath/$FolderName" -pathType container) {
|
||||||
"⏳ ($Step/$($NumEntries + 4)) Skipping 📂$($FolderName), it exists already..."
|
"⏳ ($Step/$($NumEntries + 4)) Skipping 📂$FolderName - exists already..."
|
||||||
$Skipped++
|
$Skipped++
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@ -61,9 +61,9 @@ try {
|
|||||||
}
|
}
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
if ($Cloned -eq 1) {
|
if ($Cloned -eq 1) {
|
||||||
"✔️ 1 Git repository cloned into 📂$ParentFolderName in $Elapsed sec ($Skipped skipped)."
|
"✔️ 1 repository cloned into 📂$ParentFolderName in $Elapsed sec ($Skipped skipped)."
|
||||||
} else {
|
} else {
|
||||||
"✔️ $Cloned Git repos cloned into 📂$ParentFolderName in $Elapsed sec ($Skipped skipped)."
|
"✔️ $Cloned repositories cloned into 📂$ParentFolderName in $Elapsed sec ($Skipped skipped)."
|
||||||
}
|
}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
|
Loading…
Reference in New Issue
Block a user