Update list-submodules.ps1

This commit is contained in:
Markus Fleschutz 2022-12-29 14:06:54 +01:00
parent 655dae666e
commit 379adef007

View File

@ -16,17 +16,19 @@
param([string]$RepoDir = "$PWD")
try {
"⏳ Step 1/3: Checking requirements... "
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
Write-Host "⏳ (1/4) Searching for Git executable... " -noNewline
& git --version
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
"⏳ Step 2/3: Fetching latest updates... "
$RepoDirName = (Get-Item "$RepoDir").Name
Write-Host "⏳ (2/4) Checking Git repository... 📂$RepoDirName"
if (-not(Test-Path "$RepoDir" -pathType container)) { throw "Can't access folder: $RepoDir" }
Write-Host "⏳ (3/4) Fetching latest updates... "
& git -C "$RepoDir" fetch
if ($lastExitCode -ne "0") { throw "'git fetch' failed" }
"⏳ Step 3/3: Listing submodules... "
Write-Host "⏳ (4/4) Listing submodules... "
& git -C "$RepoDir" submodule
if ($lastExitCode -ne "0") { throw "'git submodule' failed" }