Closed majkinetor closed 5 years ago
Here is one example of handling this using AU.
We could create directory streams
within packages
mkvtoolnix
streams
mkvtoolnix
mkvtoolnix.install
mkvtoolnix.portable
Each stream folder could contain files to be copied to the package directories when that stream is activated and name of the stream should be taken from the folder name.
With some special syntax we could add/remove files before packaging.
mkvtoolnix
-tools
-legal
mkvtoolnix.install
+tools\ChocolateyIntall.ps1
mkvtoolnix.portable
+tools\ChocolateyIntall.ps1
So, in this case
With this set we could have it simple in AU in a way something like:
au_BeforeUpdate() { Set-CurrentStream }
au_AfterUpdate() { Revert-CurrentStream } #this might not be needed with a bit better setup
By doing this in AU itself this could work in a magical fashion. This is not very well thoughtout at this moment, just brainstorming ideas.
Abandoning this idea. Streams are not used that much to justify such development.
What's the current best way to have two packages pkg.install
and pkg.portable
? Should I really duplicate folders and files?
There are several ways:
au_beforeUpdate
. For example Readme.install or Readme.portable to Readme.md (similar to other files).
We often have packages that reuse most of the metadata and scripts with few differences (install/portable notably, but other types exist to)
It would be useful to streamline this into single package. That would achieve:
/cc @Thilas