Skip to content

Commit

Permalink
Merge pull request #166 from theohbrothers/refactor/generate-improve-…
Browse files Browse the repository at this point in the history
…variable-interpolation-for-function-get-repositoryreleaseprevious

Refactor (generate): Improve variable interpolation for function `Get-RepositoryReleasePrevious`
  • Loading branch information
joeltimothyoh authored Jul 25, 2024
2 parents 1cea8af + 0e63aae commit 68d4339
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ function Get-RepositoryReleasePrevious {
}
# Validate specified ref is an existing ref
"Validating ref '$Ref'" | Write-Verbose
$commitSHA = git rev-parse "$Ref"
$commitSHA = git rev-parse $Ref
$commitSHA | Write-Verbose
if ($LASTEXITCODE) {
throw "An error occurred."
}
$isRefTagged = if (git tag --points-at "$Ref") {
$isRefTagged = if (git tag --points-at $Ref) {
"Ref '$Ref' is a tagged commit." | Write-Verbose
$true
}else {
Expand All @@ -49,7 +49,7 @@ function Get-RepositoryReleasePrevious {
}elseif ($TagType -eq 'All') {
$tagPattern = '.+?'
}
$tagsPreviousInfo = (git --no-pager log "$Ref" --date-order --pretty='format:%H %D') -split "`n" | % {
$tagsPreviousInfo = (git --no-pager log $Ref --date-order --pretty='format:%H %D') -split "`n" | % {
if ($_ -match "\s+tag:\s+($tagPattern)(,\s+|$)") {
$_
}
Expand Down

0 comments on commit 68d4339

Please sign in to comment.