mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-16 17:51:28 +01:00
Update list-submodules.ps1
This commit is contained in:
parent
655dae666e
commit
379adef007
@ -16,17 +16,19 @@
|
|||||||
param([string]$RepoDir = "$PWD")
|
param([string]$RepoDir = "$PWD")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
"⏳ Step 1/3: Checking requirements... "
|
Write-Host "⏳ (1/4) Searching for Git executable... " -noNewline
|
||||||
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
|
||||||
|
|
||||||
& 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" }
|
||||||
|
|
||||||
"⏳ 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
|
& git -C "$RepoDir" fetch
|
||||||
if ($lastExitCode -ne "0") { throw "'git fetch' failed" }
|
if ($lastExitCode -ne "0") { throw "'git fetch' failed" }
|
||||||
|
|
||||||
"⏳ Step 3/3: Listing submodules... "
|
Write-Host "⏳ (4/4) Listing submodules... "
|
||||||
& git -C "$RepoDir" submodule
|
& git -C "$RepoDir" submodule
|
||||||
if ($lastExitCode -ne "0") { throw "'git submodule' failed" }
|
if ($lastExitCode -ne "0") { throw "'git submodule' failed" }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user