-
Notifications
You must be signed in to change notification settings - Fork 902
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
outdated - Exit 2 when there are packages out of date (enhanced exit code) #1602
Comments
@proudcanadianeh - consider giving some examples of your preferred output for the Chocolatey Team to consider. Help steer them towards what you want. :) |
For my purposes, have an exit code of 0 if everything is up to date, 5 if stuff is out of date, 10 if there is an error checking for updates. |
I would like some exit status from The problem I have is that the python script cannot tell if an error occurs (e.g. if my internet connection is down), and reports all the error messages as available updates. This is exacerbated by two additional problems...
|
@cs96and I think you are missing an additional switch |
@cs96and Some of that could be that |
@proudcanadianeh this is a great idea! I think we'll want to approach this for next release. Error would be exit code 1 though. |
Using |
When items are outdated, the exit should indicate that it is not all good to go as there is possible work to do. A zero exit code should only be used if choco outdated does not return any results. - Exit of 0 indicates all up to date - Exit of 2 indicates out of date packages - Exit of 1 or -1 would indicate an error
* stable: (maint) Corrected whitespace (GH-1689) Delete packaging scripts before upgrade (doc) fix grammar in scripting guidelines (doc) add don't use nupkg to scripting guidelines (maint) fix typo (GH-1602) exit 2 on items outdated (doc) add step for rebasing prior to merging (GH-1614) Quote source name if includes pipe
This will be released with 0.10.12. Thanks for the patience on this one. |
In #1602 and #1724, enhanced exit codes were added to provide more intentional exit codes that determine the state of what happened during the run. This would allow simply seeing a 0 from outdated and knowing that all packages are up to date, or seeing a 2 and knowing that packages need updated. This allows for better scripting based on exit codes. However, there are some existing integrations that might be broken on taking on a newer version of Chocolatey if the enhanced exit codes are not being looked for yet. To allow compatibility to older systems, add a feature switch that can be disabled to provide the older behavior of 0 or 1 exit codes.
ERROR_FILE_NOT_FOUND
|
How to avoid the invalid exit code? |
choco feature disable --name="'useEnhancedExitCodes'" |
Would absolutely love different exit codes for choco outdated for if it does or does not find packages that need to be updated.
Would make it very easy to script a check that way.
Edited by Rob to add the following:
Release Notes
Related to #1758
The text was updated successfully, but these errors were encountered: