Commit 838484f 1 parent 4a0e218 commit 838484f Copy full SHA for 838484f
File tree 1 file changed +11
-1
lines changed
src/chocolatey/infrastructure.app/commands
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -130,12 +130,17 @@ Exit codes that normally result from running this command.
130
130
Normal:
131
131
- 0: operation was successful, no issues detected
132
132
- -1 or 1: an error has occurred
133
+ - 2: nothing to do (enhanced)
134
+
135
+ NOTE: Starting in v2.3.0, if you have the feature '{0}'
136
+ turned on, then choco will provide enhanced exit codes that allow
137
+ better integration and scripting.
133
138
134
139
If you find other exit codes that we have not yet documented, please
135
140
file a ticket so we can document it at
136
141
https://github.com/chocolatey/choco/issues/new/choose.
137
142
138
- " ) ;
143
+ " . FormatWith ( ApplicationParameters . Features . UseEnhancedExitCodes ) ) ;
139
144
140
145
"chocolatey" . Log ( ) . Info ( ChocolateyLoggers . Important , "Options and Switches" ) ;
141
146
}
@@ -218,6 +223,11 @@ public virtual void SetPin(ChocolateyConfiguration config)
218
223
else
219
224
{
220
225
this . Log ( ) . Warn ( NoChangeMessage ) ;
226
+
227
+ if ( config . Features . UseEnhancedExitCodes && Environment . ExitCode == 0 )
228
+ {
229
+ Environment . ExitCode = 2 ;
230
+ }
221
231
}
222
232
}
223
233
You can’t perform that action at this time.
0 commit comments