summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@elliehuxtable.com>2024-02-04 20:24:43 +0100
committerGitHub <noreply@github.com>2024-02-04 19:24:43 +0000
commitcc2aa6524dd9334f0d6d1af71f71d37d6725f345 (patch)
tree7742427b4af1d07f5dbc97c4ff492ebdda7131ca
parentb7bb583d8d6d2a299886449c12929d2dece5e67b (diff)
feat: disable auto record store init (#1671)
I think this makes more sense as a manual action
-rw-r--r--atuin/src/command/client/history.rs13
-rw-r--r--atuin/src/command/client/sync.rs6
2 files changed, 14 insertions, 5 deletions
diff --git a/atuin/src/command/client/history.rs b/atuin/src/command/client/history.rs
index 29a0bdf3..e9ebaec1 100644
--- a/atuin/src/command/client/history.rs
+++ b/atuin/src/command/client/history.rs
@@ -32,7 +32,9 @@ use super::search::format_duration_into;
#[command(infer_subcommands = true)]
pub enum Cmd {
/// Begins a new command in the history
- Start { command: Vec<String> },
+ Start {
+ command: Vec<String>,
+ },
/// Finishes a new command in the history (adds time, exit code)
End {
@@ -89,6 +91,8 @@ pub enum Cmd {
#[arg(long, short)]
format: Option<String>,
},
+
+ InitStore,
}
#[derive(Clone, Copy, Debug)]
@@ -375,6 +379,11 @@ impl Cmd {
Ok(())
}
+ async fn init_store(&self, db: &impl Database, history_store: HistoryStore) -> Result<()> {
+ let context = current_context();
+ history_store.init_store(context, db).await
+ }
+
pub async fn run(
self,
settings: &Settings,
@@ -431,6 +440,8 @@ impl Cmd {
Ok(())
}
+
+ Self::InitStore => self.init_store(db, history_store).await,
}
}
}
diff --git a/atuin/src/command/client/sync.rs b/atuin/src/command/client/sync.rs
index a7d57158..67840ced 100644
--- a/atuin/src/command/client/sync.rs
+++ b/atuin/src/command/client/sync.rs
@@ -2,7 +2,7 @@ use clap::Subcommand;
use eyre::{Result, WrapErr};
use atuin_client::{
- database::{current_context, Database},
+ database::Database,
encryption,
history::store::HistoryStore,
record::{sqlite_store::SqliteStore, store::Store, sync},
@@ -94,9 +94,7 @@ async fn run(
if history_length as u64 > store_history_length {
println!("History DB is longer than history record store");
println!("This happens when you used Atuin pre-record-store");
-
- let context = current_context();
- history_store.init_store(context, db).await?;
+ println!("Run atuin history init-store to correct this");
println!("\n");
}