-
Notifications
You must be signed in to change notification settings - Fork 907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different versions of choco with different behavior - How to handle this in packages? #128
Comments
#121 will handle the unzipped files. That is not a package script concern. |
When things get added you have to decide whether to use and when to use. That's how you handle new things. You can also add the script to the package and use it if a command for it is not found. |
There are examples of doing that with bin root. Also, this seems more like a question than an issue - please use the gitter chat room for that - https://gitter.im/chocolatey/choco |
I think this can be closed, unless we want this to be a documentation issue. We've added new functions over time before though. |
Perhaps we could document a way for the package to determine Chocolatey version. |
In most cases, feature detection would be better. You can see an example here: https://github.com/dhilgarth/chocolatey-packages/blob/master/automatic/procmon/tools/chocolateyinstall.ps1#L12 |
@dhilgarth yes, but it's a bit more work on the maintainer to do so. |
So you propose to include the new module with the package? |
Usually if you want to take advantage of the feature but support older versions, you either do all of the work yourself or just include the function. It's less boilerplate for you to write if you include the function. |
I agree that feature detection is generally more robust. However, in Chocolatey, only the presence of helper functions can be currently detected, so this method could not be used to handle Chocolatey behavior changes (such as the removal of unzipped files - fortunately, this one will not change after all). |
Duplicate of #121 |
I am wondering how to handle the different behavior of different choco versions in packages.
For example, PowerShell choco removed the unzipped files. Choco 0.9.9-rc8 doesn't.
Likewise, PowerShell choco doesn't have
Install-ChocolateyShortcut
but the new choco does.What is the best practice in making packages work in all environments?
The text was updated successfully, but these errors were encountered: