From c5eea816ee5980512e713d033659ceeb7191a622 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Sat, 4 Nov 2023 10:20:47 +0100 Subject: [PATCH] Update list-repos.ps1 --- scripts/list-repos.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/list-repos.ps1 b/scripts/list-repos.ps1 index bec9a87d..987d59d3 100755 --- a/scripts/list-repos.ps1 +++ b/scripts/list-repos.ps1 @@ -8,8 +8,8 @@ .EXAMPLE PS> ./list-repos C:\MyRepos - Repository Latest Tag Branch Status Remote - ---------- ---------- ------ ------ ------ + Local Repo Latest Tag Branch Status Remote URL + ---------- ---------- ------ ------ ---------- 📂cmake v3.23.0 main ✔️clean git@github.com:Kitware/CMake ↓0 ... .LINK @@ -23,7 +23,7 @@ param([string]$ParentDir = "$PWD") function ListRepos { $Folders = (Get-ChildItem "$ParentDir" -attributes Directory) foreach($Folder in $Folders) { - $Repository = (Get-Item "$Folder").Name + $FolderName = (Get-Item "$Folder").Name $LatestTagCommitID = (git -C "$Folder" rev-list --tags --max-count=1) if ($LatestTagCommitID -ne "") { $LatestTag = (git -C "$Folder" describe --tags $LatestTagCommitID) @@ -36,7 +36,7 @@ function ListRepos { $Status = (git -C "$Folder" status --short) if ("$Status" -eq "") { $Status = "✔️clean" } elseif ("$Status" -like " M *") { $Status = "⚠️modified" } - New-Object PSObject -property @{'Repository'="📂$Repository";'Latest Tag'="$LatestTag";'Branch'="$Branch";'Status'="$Status";'Remote'="$RemoteURL ↓$NumCommits";} + New-Object PSObject -property @{'Local Repo'="📂$FolderName";'Latest Tag'="$LatestTag";'Branch'="$Branch";'Status'="$Status";'Remote URL'="$RemoteURL ↓$NumCommits";} } } @@ -46,7 +46,7 @@ try { $Null = (git --version) if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } - ListRepos | Format-Table -property @{e='Repository';width=20},@{e='Latest Tag';width=18},@{e='Branch';width=20},@{e='Status';width=10},Remote + ListRepos | Format-Table -property @{e='Local Repo';width=19},@{e='Latest Tag';width=18},@{e='Branch';width=20},@{e='Status';width=10},'Remote URL' exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"