majkinetor / au

Chocolatey Automatic Package Updater Module
GNU General Public License v2.0
227 stars 71 forks source link

How to avoid adding date revision number to the packageName and nuspec file in force update #253

Closed moh-hassan closed 2 years ago

moh-hassan commented 2 years ago

When run the demo with the command

 $au_Force = $true; .\update.ps1

if nuspec version match the remote version, i.e 5.0.0, au use date as a revision number and attach it to Version and generate package like: copyq.5.0.0.20211117.nupkg

and nuspec version is modified to: <version>5.0.0.20211117</version>

How to avoid adding date revision number in force update?

majkinetor commented 2 years ago

Use $au_Version.

moh-hassan commented 2 years ago

Thanks for reply. How to use $au_Version. I used it like this :

function global:au_BeforeUpdate {     
    $au_Version='5.0.0'  #todod remove revision number
}

Is it right?

majkinetor commented 2 years ago

$au_Force = $true; $au_version = "5.0.0"; .\update.ps1

moh-hassan commented 2 years ago

I didn't want to pass a fixed value. I want to use the $au_version by dropping the revision number. Is the above script the best use for dropping the revision number?

majkinetor commented 2 years ago

OK, set version in nuspec file to 0.0 programatically before calling update. Then it will never be fixed.

moh-hassan commented 2 years ago

It works. It's fine if there is a parameter -DropRevision to use only x.y.z version (SemVer)