mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-29 13:14:49 +02:00
Update list-commits.ps1
This commit is contained in:
parent
0ed2168295
commit
ad3cb047c6
@ -24,20 +24,21 @@
|
|||||||
param([string]$RepoDir = "$PWD", [string]$Format = "list")
|
param([string]$RepoDir = "$PWD", [string]$Format = "list")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
if (-not(Test-Path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
||||||
|
|
||||||
$Null = (git --version)
|
$Null = (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" }
|
||||||
|
|
||||||
write-progress "🢃 Fetching latest tags..."
|
Write-Progress "🢃 Fetching latest tags..."
|
||||||
& git -C "$RepoDir" fetch --all --quiet
|
& git -C "$RepoDir" fetch --all --quiet
|
||||||
if ($lastExitCode -ne "0") { throw "'git fetch' failed" }
|
if ($lastExitCode -ne "0") { throw "'git fetch' failed" }
|
||||||
|
Write-Progress -Completed " "
|
||||||
|
|
||||||
if ($Format -eq "list") {
|
if ($Format -eq "list") {
|
||||||
""
|
""
|
||||||
"ID Date Committer Description"
|
"Hash Date Author Description"
|
||||||
"-- ---- --------- -----------"
|
"---- ---- ------ -----------"
|
||||||
& git log --pretty=format:"%h%x09%ad%x09%an%x09%s"
|
& git log --pretty=format:"%h%x09%cs%x09%an%x09%s"
|
||||||
} elseif ($Format -eq "compact") {
|
} elseif ($Format -eq "compact") {
|
||||||
""
|
""
|
||||||
"List of Git Commits"
|
"List of Git Commits"
|
||||||
|
Loading…
Reference in New Issue
Block a user