mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-26 18:03:35 +01:00
Improved both scripts
This commit is contained in:
parent
68711177c5
commit
6fa8ed3a78
@ -11,7 +11,7 @@ param($RepoDir = "$PWD")
|
|||||||
try {
|
try {
|
||||||
write-output "Fetching repository $RepoDir ..."
|
write-output "Fetching repository $RepoDir ..."
|
||||||
|
|
||||||
if (-not(test-path "$RepoDir")) { throw "Repository at $RepoDir is non-existing" }
|
if (-not(test-path "$RepoDir")) { throw "Can't access Git repository at: $RepoDir" }
|
||||||
set-location "$RepoDir"
|
set-location "$RepoDir"
|
||||||
|
|
||||||
& git --version
|
& git --version
|
||||||
|
@ -9,15 +9,17 @@
|
|||||||
param($RepoDir = "$PWD", $Pattern = "*")
|
param($RepoDir = "$PWD", $Pattern = "*")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$null = $(git --version)
|
write-output "Listing Git branches of repository $RepoDir ..."
|
||||||
} catch {
|
|
||||||
write-error "ERROR: can't execute 'git' - make sure Git is installed and available"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
if (-not(test-path "$RepoDir")) { throw "Can't access Git repository at: $RepoDir" }
|
||||||
set-location $RepoDir
|
set-location $RepoDir
|
||||||
|
|
||||||
|
$null = (git --version)
|
||||||
|
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||||
|
|
||||||
|
& git fetch --recurse-submodules
|
||||||
|
if ($lastExitCode -ne "0") { throw "'git fetch --recurse-submodules' failed" }
|
||||||
|
|
||||||
$Branches = $(git branch --list --remotes --no-color --no-column)
|
$Branches = $(git branch --list --remotes --no-color --no-column)
|
||||||
if ($lastExitCode -ne "0") { throw "'git branch --list' failed" }
|
if ($lastExitCode -ne "0") { throw "'git branch --list' failed" }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user