diff options
Diffstat (limited to 'atuin/src/command/client/store/rebuild.rs')
-rw-r--r-- | atuin/src/command/client/store/rebuild.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/atuin/src/command/client/store/rebuild.rs b/atuin/src/command/client/store/rebuild.rs index 880647b4..f99d3247 100644 --- a/atuin/src/command/client/store/rebuild.rs +++ b/atuin/src/command/client/store/rebuild.rs @@ -1,3 +1,4 @@ +use atuin_dotfiles::store::AliasStore; use clap::Args; use eyre::{bail, Result}; @@ -28,6 +29,10 @@ impl Rebuild { .await?; } + "dotfiles" => { + self.rebuild_dotfiles(settings, store.clone()).await?; + } + tag => bail!("unknown tag: {tag}"), } @@ -49,4 +54,15 @@ impl Rebuild { Ok(()) } + + async fn rebuild_dotfiles(&self, settings: &Settings, store: SqliteStore) -> Result<()> { + let encryption_key: [u8; 32] = encryption::load_key(settings)?.into(); + + let host_id = Settings::host_id().expect("failed to get host_id"); + let alias_store = AliasStore::new(store, host_id, encryption_key); + + alias_store.build().await?; + + Ok(()) + } } |