mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-08 00:54:04 +01:00
Update list-submodules.ps1
This commit is contained in:
parent
655dae666e
commit
379adef007
@ -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" }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user