majkinetor / au

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

au_GalleryUrl does not work with Update-AUPackages #254

Closed danmetzler closed 2 years ago

danmetzler commented 2 years ago

While working on #250, I discovered that $au_GalleryUrl is implemented as a variable in the logic of Update-Package, but it is not implemented as a parameter or environment variable anywhere else.

A work around is that we can set the global variable in every update.ps1 script of each package, but this doesn't feel like the way it was intended.

danmetzler commented 2 years ago

I'm thinking this might work better if $au_GalleryUrl, or its replacement $au_GalleryPackageRootUrl (#250), were also implemented as part of the $Options parameter for Update-AUPackages.

There may be other ways to address this, but that's one option that should work.

danmetzler commented 2 years ago

While thinking about this, just a side comment. I see data passed into Update-AUPackages and Update-Package using parameters, global variables set outside the AU module code, and environment variables. It seems like some things are available as an environment varirable, and others aren't. Is there a strategy around when something is implemented as global variable vs environment variable vs parameter vs combination of those?

majkinetor commented 2 years ago

No particular strategy. Just organic growth. Should be env vars.