fix(files): files:scan error ouput when user_id is not found + return correct exit status on error #49412
+69
−62
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Note: This looks like a lengthier change than it really is due to moving the location of
execute()
for readability.occ files:scan
misinterprets wrong path as username #27031 (improves error output when user_id in path is invalid)occ
output not quiet when it should be, exit code not proper #27029 (adds exit status 1 if any errors occur during a run) [lines 154-156]execute()
function location to immediately afterconfigure()
for readability / consistencyocc
command description and adds helpCommand
output)TODO
Notes
There are two behavior changes here to be aware of (in order order of probably significance in terms of being classified as a "breaking change"):
Exit code
Previously even where there were errors the exit code (i.e.
echo $?
) was still0
. Now any errors mean the code will be1
.Output is slightly different when user_id is not found (e.g. see #27031 for existing behavior):
Now it is:
Output
Output of
occ files
with this PR:Output of
occ files:scan --help
with this PR:Checklist