Skip to content

Commit

Permalink
Merge pull request #6 from OfficialEsco/More-CommitTypes
Browse files Browse the repository at this point in the history
Differentiate between Upgrade and New Version
  • Loading branch information
OfficialEsco authored Aug 7, 2021
2 parents 0e16c11 + 6bf2365 commit 2bcf0fc
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Tools/YamlCreate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -832,10 +832,10 @@ Function Submit-Manifest {
if ($PromptSubmit -eq '0') {
switch ($Option) {
'New' {
if ($script:OldManifestType -eq 'None') { $CommitType = 'New' }
else {
$CommitType = 'Update'
}
if ( $script:OldManifestType -eq 'None' ) { $CommitType = 'New package' }
elseif ($script:LastVersion -lt $script:PackageVersion ) { $CommitType = 'New version' }
elseif ($script:PackageVersion -in $script:ExistingVersions) { $CommitType = 'Update' }
elseif ($script:LastVersion -gt $script:PackageVersion ) { $CommitType = 'Add version' }
}
'EditMetadata' { $CommitType = 'Metadata' }
'NewLocale' { $CommitType = 'Locale' }
Expand Down Expand Up @@ -1101,7 +1101,8 @@ Function Read-PreviousWinGet-Manifest-Yaml {

if (!$LastVersion) {
try {
$LastVersion = Split-Path (Split-Path (Get-ChildItem -Path "$AppFolder\..\" -Recurse -Depth 1 -File).FullName ) -Leaf | Sort-Object $ToNatural | Select-Object -Last 1
$script:LastVersion = Split-Path (Split-Path (Get-ChildItem -Path "$AppFolder\..\" -Recurse -Depth 1 -File).FullName ) -Leaf | Sort-Object $ToNatural | Select-Object -Last 1
$script:ExistingVersions = Split-Path (Split-Path (Get-ChildItem -Path "$AppFolder\..\" -Recurse -Depth 1 -File).FullName ) -Leaf | Sort-Object $ToNatural | Select-Object -Unique
Write-Host -ForegroundColor 'DarkYellow' -Object "Found Existing Version: $LastVersion"
$script:OldManifests = Get-ChildItem -Path "$AppFolder\..\$LastVersion"
}
Expand Down

0 comments on commit 2bcf0fc

Please sign in to comment.