fix: preserve conda exit status in fish wrapper function#14752
fix: preserve conda exit status in fish wrapper function#14752holgerdell wants to merge 2 commits intoconda:mainfrom
Conversation
|
We require contributors to sign our Contributor License Agreement and we don't have one on file for @holgerdell. In order for us to review and merge your code, please e-sign the Contributor License Agreement PDF. We then need to manually verify your signature, merge the PR (conda/infrastructure#1146), and ping the bot to refresh the PR. |
da1d972 to
24d90e7
Compare
|
@conda-bot check |
1 similar comment
|
@conda-bot check |
CodSpeed Performance ReportMerging #14752 will not alter performanceComparing Summary
|
Fixes an issue where certain conda operations in fish (such as `conda update`) incorrectly returned an exit status of 4 instead of 0. This occurred because unsetting undefined variables with `set -e` in recent fish versions (e.g., 4.0.2) returns an exit status of 4. The fix simply ignores any error caused by the `set -e` command.
|
@kenodegard I changed the pull request: Instead of editing |
|
This is a duplicate of #14660. |
|
The problem is solved and the pr can be closed. @holgerdell |
Fixes an issue where the conda fish wrapper function was incorrectly returning
exit status 4 after successful conda operations. This occurred because the
eval ($CONDA_EXE shell.fish reactivate)command fails with status 4 whenattempting to unset non-existent variables with
set -e.The fix captures the original conda command's exit status before reactivation
and explicitly returns it, ensuring the function returns the status of the
actual conda operation rather than the status of the environment reactivation.
This maintains the intended behavior where reactivation only occurs for
successful commands while properly preserving error codes for error handling.
Description
I noticed that the command
conda update --allreturns an incorrect exit code of 4 after usingconda activatein thefishshell. The reason is that the fish functioncondareturns the exit code ofeval ($CONDA_EXE shell.fish reactivate), which in turn is 4 if the variable undefined and then unset byset -e _CE_Min$CONDA_EXE shell.fish reactivate. This pull request fixes this issue.Checklist - did you ...
newsdirectory (using the template) for the next release's release notes?[ ] Add / update necessary tests?[ ] Add / update outdated documentation?