Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Thilas authored Nov 24, 2017
1 parent 888ad3a commit 4d16d1a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,16 @@ The software vendor may maintain _multiple latest versions_, of specific release
function global:au_GetLatest {
# ...
@{
Streams = @{
'1.2' = @{ Version = $version12; URL32 = $url12 } # $version12 = '1.2.3.1'
Streams = [ordered] @{
'1.3' = @{ Version = $version13; URL32 = $url13 } # $version13 = '1.3.9'
'1.2' = @{ Version = $version12; URL32 = $url12 } # $version12 = '1.2.3.1'
}
}
}
```

Though a `Hashtable` can be returned for streams, it is recommended to return an `OrderedDictionary` (see above example) that contains streams from the most recent to the oldest one. This ensures that when forcing an update, the most recent stream available will be considered by default (i.e. when no `-IncludeStream` is specified).

Latest stream versions are kept in the `<package_name>.json` file in the package directory. For real life example take a look at the [Python3](https://github.com/chocolatey/chocolatey-coreteampackages/blob/master/automatic/python3/update.ps1) package updater which automatically finds available python 3 streams and keeps them [up to date](https://gist.github.com/a14b1e5bfaf70839b338eb1ab7f8226f/78cdc99c2d7433d26c65bc721c26c1cc60ccca3d#python3).

Streams can be also used to manage multiple related packages as a single package. [LibreOffice](https://github.com/chocolatey/chocolatey-coreteampackages/blob/master/automatic/libreoffice/update.ps1) package updater uses streams to manage [two different](https://gist.github.com/choco-bot/a14b1e5bfaf70839b338eb1ab7f8226f/78cdc99c2d7433d26c65bc721c26c1cc60ccca3d#libreoffice) variants of the software (prior to streams this was handled via 2 packages.)
Expand Down

0 comments on commit 4d16d1a

Please sign in to comment.