Repository navigation
fix(uninstall): do not create the folders a dry run then lists for removal #907
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
Changes from all commits
cef74ba
990cc08
5c23c7f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -330,14 +330,15 @@ fn run() -> Result<()> { | |
| // non-blocking file writer, so an early drop would silently truncate the | ||
| // log. A failed/missing `AppPaths::discover()` degrades to no logging | ||
| // rather than a startup failure. | ||
| let _log_guard = AppPaths::discover() | ||
| .ok() | ||
| let raw_args: Vec<String> = std::env::args().skip(1).collect(); | ||
| let _log_guard = logging::is_enabled_for(&raw_args) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Non-blocking, related:
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed that this is a real remaining side effect, and I'm leaving it out of this change on purpose: |
||
| .then(AppPaths::discover) | ||
| .and_then(Result::ok) | ||
| .and_then(|paths| logging::init(&paths)); | ||
|
|
||
| maybe_migrate_legacy_dashboard_config(); | ||
| maybe_notice_legacy_uv_cache(); | ||
|
|
||
| let raw_args: Vec<String> = std::env::args().skip(1).collect(); | ||
| if raw_args.is_empty() { | ||
| return launch_default(); | ||
| } | ||
|
|
||
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.
Non-blocking: the skip decision relies on the subcommand being argv[1]. That holds today (no global flags, no uninstall alias), but a future global flag would silently re-enable the logger, and only the e2e scenario would catch it. A comment next to the clap definition, or deriving this from the parsed command, would make that coupling harder to miss.
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.
Fixed in 990cc08. The coupling is now guarded by a unit test that fails, and names the cause, when the top-level command gains an argument (a global flag that could come before the subcommand), when any subcommand answers to
uninstallas an alias, or when an abbreviated name such asuninstalreaches it. I checked that it goes red for a global flag and for an alias onuninstall. TheClidefinition also carries a comment pointing atlogging::is_enabled_forand the test. I kept the argv[1] check itself rather than deriving the decision from the parsed command, because the logger has to be started or skipped before parsing.