-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: cleanup invalid symlinks in .local/state/mise/(tracked|trusted)…
…-configs
- Loading branch information
Showing
4 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use crate::{ | ||
cli::trust::Trust, | ||
config::{tracking::Tracker, Settings}, | ||
}; | ||
use eyre::Result; | ||
|
||
/// [experimental] Prune tracked and trusted config file references | ||
#[derive(Debug, clap::Args)] | ||
#[clap(verbatim_doc_comment, after_long_help = AFTER_LONG_HELP)] | ||
pub struct ConfigPrune {} | ||
|
||
impl ConfigPrune { | ||
pub fn run(self) -> Result<()> { | ||
let settings = Settings::try_get()?; | ||
settings.ensure_experimental("`mise config prune`")?; | ||
debug!("pruning tracked configs"); | ||
Tracker::clean()?; | ||
|
||
debug!("pruning trusted configs"); | ||
Trust::clean()?; | ||
|
||
info!("pruned config file references"); | ||
Ok(()) | ||
} | ||
} | ||
|
||
static AFTER_LONG_HELP: &str = color_print::cstr!( | ||
r#"<bold><underline>Examples:</underline></bold> | ||
$ <bold>mise config prune</bold> | ||
"# | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters