mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-16 17:51:28 +01:00
Improve both scripts
This commit is contained in:
parent
b6e2063215
commit
35255539df
@ -15,18 +15,17 @@ param($RepoDir = "$PWD")
|
||||
|
||||
try {
|
||||
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
||||
set-location "$RepoDir"
|
||||
|
||||
$RepoDirName = (get-item "$RepoDir").Name
|
||||
"⏳ Fetching updates for Git repository 📂$RepoDirName ..."
|
||||
|
||||
|
||||
$Null = (git --version)
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
& git fetch --all --recurse-submodules --jobs=4
|
||||
|
||||
$RepoDirName = (get-item "$RepoDir").Name
|
||||
"🢃 Fetching updates for Git repository 📂$RepoDirName ..."
|
||||
|
||||
& git -C "$RepoDir" fetch --all --recurse-submodules --jobs=4
|
||||
if ($lastExitCode -ne "0") { throw "'git fetch' failed" }
|
||||
|
||||
"✔️ fetched Git repository 📂$RepoDirName"
|
||||
"✔️ fetched updates for 📂$RepoDirName"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -15,18 +15,17 @@ param($RepoDir = "$PWD")
|
||||
|
||||
try {
|
||||
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
||||
set-location "$RepoDir"
|
||||
|
||||
$RepoDirName = (get-item "$RepoDir").Name
|
||||
"⏳ Fetching updates for Git repository 📂$RepoDirName ..."
|
||||
|
||||
$Null = (git --version)
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
& git fetch
|
||||
$RepoDirName = (get-item "$RepoDir").Name
|
||||
"🢃 Fetching updates for 📂$RepoDirName ..."
|
||||
|
||||
& git -C "$RepoDir" fetch
|
||||
if ($lastExitCode -ne "0") { throw "'git fetch' failed" }
|
||||
|
||||
$Tag = (git describe --tags --abbrev=0)
|
||||
$Tag = (git -C "$RepoDir" describe --tags --abbrev=0)
|
||||
"🔖$Tag"
|
||||
exit 0
|
||||
} catch {
|
||||
|
Loading…
Reference in New Issue
Block a user