-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
fix(files): files:scan error ouput when user_id is not found + return correct exit status on error #49412
base: master
Are you sure you want to change the base?
fix(files): files:scan error ouput when user_id is not found + return correct exit status on error #49412
Conversation
) | ||
->addOption( | ||
'path', | ||
'p', | ||
InputOption::VALUE_REQUIRED, | ||
'limit rescan to this path, eg. --path="/alice/files/Music", the user_id is determined by the path and the user_id parameter and --all are ignored' | ||
'Limit rescan to the specified path, eg. --path="/alice/files/Music". Overrides the user_id and --all parameters; the user_id is determined from the path.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Limit rescan to the specified path, eg. --path="/alice/files/Music". Overrides the user_id and --all parameters; the user_id is determined from the path.' | |
'Limit rescan to the specified path, eg. --path="/alice/files/Music". Overrides the user_id and --all parameters.' |
files:scan
+ misc fixesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe do not move the execute method to ease the review, or do that in a different commit :)
@@ -55,48 +55,109 @@ protected function configure(): void { | |||
|
|||
$this | |||
->setName('files:scan') | |||
->setDescription('rescan filesystem') | |||
->setDescription('Scans the filesystem for new files and updates the file cache') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe more explicit, as it does not only detect new files.
->setDescription('Scans the filesystem for new files and updates the file cache') | |
->setDescription('Scans the filesystem and updates the file cache acording to the detected additions, deletions and updates.') |
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