From 5b586a8511d4c54919526b4458dfe88ccf811c86 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Wed, 11 Aug 2021 07:49:11 +0200 Subject: [PATCH] Improve list-lastest-tag.ps1 and list-latest-tags.ps1 --- Scripts/list-latest-tag.ps1 | 12 ++++++------ Scripts/list-latest-tags.ps1 | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Scripts/list-latest-tag.ps1 b/Scripts/list-latest-tag.ps1 index e03b1cb0..d2ffc85e 100755 --- a/Scripts/list-latest-tag.ps1 +++ b/Scripts/list-latest-tag.ps1 @@ -20,14 +20,14 @@ try { $Null = (git --version) if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } - $RepoDirName = (get-item "$RepoDir").Name - "🢃 Fetching updates for 📂$RepoDirName ..." +# $RepoDirName = (get-item "$RepoDir").Name +# "🢃 Fetching updates for 📂$RepoDirName ..." +# & git -C "$RepoDir" fetch --tags +# if ($lastExitCode -ne "0") { throw "'git fetch --tags' failed" } - & git -C "$RepoDir" fetch --tags - if ($lastExitCode -ne "0") { throw "'git fetch --tags' failed" } + $LatestTag = (git -C "$RepoDir" describe --tags --abbrev=0 --always) + "🔖$LatestTag" - $Tag = (git -C "$RepoDir" describe --tags --abbrev=0) - "🔖$Tag" exit 0 } catch { write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/Scripts/list-latest-tags.ps1 b/Scripts/list-latest-tags.ps1 index 457dace8..2445879e 100755 --- a/Scripts/list-latest-tags.ps1 +++ b/Scripts/list-latest-tags.ps1 @@ -28,10 +28,10 @@ try { foreach ($Folder in $Folders) { $FolderName = (get-item "$Folder").Name - & git -C "$Folder" fetch --tags - if ($lastExitCode -ne "0") { throw "'git fetch --tags' failed" } +# & git -C "$Folder" fetch --tags +# if ($lastExitCode -ne "0") { throw "'git fetch --tags' failed" } - $LatestTag = (git -C "$Folder" describe --tags --abbrev=0) + $LatestTag = (git -C "$Folder" describe --tags --abbrev=0 --always) "* $FolderName $LatestTag" } exit 0