From 470cfcbb2f2dcb4efbf10f4c8dc65aeed9a526c2 Mon Sep 17 00:00:00 2001 From: Markus Date: Sun, 23 Jan 2022 18:49:36 +0100 Subject: [PATCH] Update clone-repos.ps1 --- Scripts/clone-repos.ps1 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Scripts/clone-repos.ps1 b/Scripts/clone-repos.ps1 index d7e1eb0c..d18f70eb 100755 --- a/Scripts/clone-repos.ps1 +++ b/Scripts/clone-repos.ps1 @@ -19,7 +19,7 @@ try { $StopWatch = [system.diagnostics.stopwatch]::startNew() if (-not(test-path "$FolderPath" -pathType container)) { throw "Can't access directory: $FolderPath" } - $ParentFolderName = (get-item "$FolderPath").Name + $ParentFolderName = (Get-Item "$FolderPath").Name $Null = (git --version) if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } @@ -39,18 +39,19 @@ try { $Step++ if (test-path "$FolderPath/$FolderName" -pathType container) { - "⏳ Step $Step/$($NumEntries): skipping already existing 📂$($FolderName)..." + "⏳ Step $Step/$($NumEntries): Skipping already existing 📂$($FolderName)..." $Skipped++ continue } if ($Shallow -eq "yes") { - "⏳ Step $Step/$($NumEntries): cloning shallow $Branch branch to 📂$($FolderName)..." + "⏳ Step $Step/$($NumEntries): Cloning shallow $Branch branch to 📂$($FolderName)..." & git clone --branch "$Branch" --depth 1 --shallow-submodules --recurse-submodules "$URL" "$FolderPath/$FolderName" + if ($lastExitCode -ne "0") { throw "'git clone $URL' failed" } } else { - "⏳ Step $Step/$($NumEntries): cloning full $Branch branch to 📂$FolderName..." + "⏳ Step $Step/$($NumEntries): Cloning full $Branch branch to 📂$FolderName..." & git clone --branch "$Branch" --recurse-submodules "$URL" "$FolderPath/$FolderName" + if ($lastExitCode -ne "0") { throw "'git clone $URL' failed" } } - if ($lastExitCode -ne "0") { throw "'git clone $URL' failed" } $Cloned++ } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds