mirror of
https://github.com/atuinsh/atuin.git
synced 2025-01-29 01:29:51 +01:00
feat: disable auto record store init (#1671)
I think this makes more sense as a manual action
This commit is contained in:
parent
b7bb583d8d
commit
cc2aa6524d
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user