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

bat cache --clear should clear the --target dir if specified #2392

Closed
aaronkollasch opened this issue Nov 2, 2022 · 0 comments · Fixed by #2393
Closed

bat cache --clear should clear the --target dir if specified #2392

aaronkollasch opened this issue Nov 2, 2022 · 0 comments · Fixed by #2393
Labels
feature-request New feature or request good first issue Good for newcomers

Comments

@aaronkollasch
Copy link
Contributor

aaronkollasch commented Nov 2, 2022

While bat cache --clear accepts a --target dir argument, it always clears the default cache dir regardless of --target.

Instead, bat cache --clear should clear the --target dir if one is provided.

Fixing this would allow the bat cache --clear function to be tested in an temporary directory. The relevant test is already written and can be enabled by removing the ignore flag on the cache_clear function:

#[test]
#[ignore]
fn cache_clear() {
let src_dir = "cache_source";
let tmp_dir = tempdir().expect("can create temporary directory");

Originally posted in #2381 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants