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: cleanup invalid symlinks in .local/state/mise/(tracked|trusted)-configs #2036

Merged
merged 1 commit into from
May 6, 2024

Conversation

roele
Copy link
Contributor

@roele roele commented May 6, 2024

Fixes #2020 by introducing an experimental mise config prune command to prune invalid config file references from .local/state/mise/(tracked|trusted)-configs.

@jdx
Copy link
Owner

jdx commented May 6, 2024

I think I'd prefer mise prune --config but I'm open to a reason why we would put it here instead

@roele
Copy link
Contributor Author

roele commented May 6, 2024

This was my first thought as well but i would not like to prune any tools so it felt a bit weird to use an option and have to pass the additional --dry-run to ensure nothing else is pruned.

@jdx
Copy link
Owner

jdx commented May 6, 2024

Ah yeah I did not think of that

src/cli/config/prune.rs Outdated Show resolved Hide resolved
@roele
Copy link
Contributor Author

roele commented May 6, 2024

We probably also should also ensure in mise prune that both are cleaned up.

@jdx
Copy link
Owner

jdx commented May 6, 2024

I'm not sure. I think there probably will be some small subset of users with directories that come and go which also use prune to clear out old tools—they may want references that don't exist

@roele
Copy link
Contributor Author

roele commented May 6, 2024

Up until now, the tracked configs have been cleanup up as part of Tracker::list_all(). I moved that out to make it more explicit but we can skip the cleanup of those for prune completely.

@jdx
Copy link
Owner

jdx commented May 6, 2024

Here's a thought, maybe we put everything under mise prune but if you specify --tools or --config that would filter so as to only prune that type. No args would essentially be like a (nonexistent) --all.

It might be worth looking at what docker system prune is doing for a potential reference.

src/cli/config/prune.rs Outdated Show resolved Hide resolved
src/cli/prune.rs Outdated Show resolved Hide resolved
@jdx jdx merged commit 6c557cf into jdx:main May 6, 2024
6 checks passed
@roele roele deleted the issues/2020 branch May 7, 2024 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cleanup invalid symlinks in .local/state/mise/(tracked|trusted)-configs
2 participants