Skip to content
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

feat(cli): command clean #2528

Merged
merged 2 commits into from
May 8, 2024
Merged

feat(cli): command clean #2528

merged 2 commits into from
May 8, 2024

Conversation

ematipico
Copy link
Member

Summary

Closes #1450

Test Plan

I tested it locally

@github-actions github-actions bot added the A-CLI Area: CLI label Apr 19, 2024
@ematipico ematipico marked this pull request as draft April 19, 2024 15:35
@ematipico ematipico marked this pull request as ready for review May 4, 2024 06:53
@ematipico ematipico added the S-Feature Status: new feature to implement label May 4, 2024
@ematipico ematipico added this to the Biome 1.8 milestone May 6, 2024
@ematipico ematipico requested review from a team May 6, 2024 15:57
/// Runs the clean command
pub fn clean(_cli_session: CliSession) -> Result<(), CliDiagnostic> {
let logs_dir = biome_log_dir();
remove_dir_all(logs_dir.clone()).and_then(|_| create_dir(logs_dir))?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we immediately recreate the dir? Wouldn't it be automatically recreated the next time you run biome anyway? If so, it feels "cleaner" to just remove and leave it at that...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's a Daemon running, it won't log anything anymore, and users would need to restart it manually to recreate the folder

@ematipico ematipico merged commit 813eb1b into main May 8, 2024
13 checks passed
@ematipico ematipico deleted the feat/clean-command branch May 8, 2024 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: CLI S-Feature Status: new feature to implement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 vscode extension fills hard drive with biome server logs
4 participants