From a5e1d252877af0d7c453a209156205ce6ce9739d Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Mon, 4 Mar 2024 15:49:28 +0000 Subject: [PATCH] refactor: rename atuin-config to atuin-dotfiles (#1817) --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- {atuin-config => atuin-dotfiles}/Cargo.toml | 2 +- {atuin-config => atuin-dotfiles}/src/lib.rs | 0 {atuin-config => atuin-dotfiles}/src/shell.rs | 0 {atuin-config => atuin-dotfiles}/src/shell/bash.rs | 0 {atuin-config => atuin-dotfiles}/src/shell/fish.rs | 0 {atuin-config => atuin-dotfiles}/src/shell/xonsh.rs | 0 {atuin-config => atuin-dotfiles}/src/shell/zsh.rs | 0 {atuin-config => atuin-dotfiles}/src/store.rs | 0 atuin/Cargo.toml | 2 +- atuin/src/command/client.rs | 6 +++--- atuin/src/command/client/{config.rs => dotfiles.rs} | 0 atuin/src/command/client/{config => dotfiles}/alias.rs | 2 +- atuin/src/command/client/init.rs | 2 +- atuin/src/command/client/init/bash.rs | 4 ++-- atuin/src/command/client/init/fish.rs | 4 ++-- atuin/src/command/client/init/xonsh.rs | 4 ++-- atuin/src/command/client/init/zsh.rs | 4 ++-- 19 files changed, 18 insertions(+), 18 deletions(-) rename {atuin-config => atuin-dotfiles}/Cargo.toml (96%) rename {atuin-config => atuin-dotfiles}/src/lib.rs (100%) rename {atuin-config => atuin-dotfiles}/src/shell.rs (100%) rename {atuin-config => atuin-dotfiles}/src/shell/bash.rs (100%) rename {atuin-config => atuin-dotfiles}/src/shell/fish.rs (100%) rename {atuin-config => atuin-dotfiles}/src/shell/xonsh.rs (100%) rename {atuin-config => atuin-dotfiles}/src/shell/zsh.rs (100%) rename {atuin-config => atuin-dotfiles}/src/store.rs (100%) rename atuin/src/command/client/{config.rs => dotfiles.rs} (100%) rename atuin/src/command/client/{config => dotfiles}/alias.rs (97%) diff --git a/Cargo.lock b/Cargo.lock index 50ffc518..a27eab14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,7 +185,7 @@ dependencies = [ "async-trait", "atuin-client", "atuin-common", - "atuin-config", + "atuin-dotfiles", "atuin-server", "atuin-server-postgres", "base64 0.21.7", @@ -291,7 +291,7 @@ dependencies = [ ] [[package]] -name = "atuin-config" +name = "atuin-dotfiles" version = "0.1.0" dependencies = [ "atuin-client", diff --git a/Cargo.toml b/Cargo.toml index 29ff07dd..5090889c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ members = [ "atuin-server-postgres", "atuin-server-database", "atuin-common", - "atuin-config", + "atuin-dotfiles", ] resolver = "2" diff --git a/atuin-config/Cargo.toml b/atuin-dotfiles/Cargo.toml similarity index 96% rename from atuin-config/Cargo.toml rename to atuin-dotfiles/Cargo.toml index b6fffbf4..1305f521 100644 --- a/atuin-config/Cargo.toml +++ b/atuin-dotfiles/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "atuin-config" +name = "atuin-dotfiles" edition = "2021" version = "0.1.0" # intentionally not the same as the rest diff --git a/atuin-config/src/lib.rs b/atuin-dotfiles/src/lib.rs similarity index 100% rename from atuin-config/src/lib.rs rename to atuin-dotfiles/src/lib.rs diff --git a/atuin-config/src/shell.rs b/atuin-dotfiles/src/shell.rs similarity index 100% rename from atuin-config/src/shell.rs rename to atuin-dotfiles/src/shell.rs diff --git a/atuin-config/src/shell/bash.rs b/atuin-dotfiles/src/shell/bash.rs similarity index 100% rename from atuin-config/src/shell/bash.rs rename to atuin-dotfiles/src/shell/bash.rs diff --git a/atuin-config/src/shell/fish.rs b/atuin-dotfiles/src/shell/fish.rs similarity index 100% rename from atuin-config/src/shell/fish.rs rename to atuin-dotfiles/src/shell/fish.rs diff --git a/atuin-config/src/shell/xonsh.rs b/atuin-dotfiles/src/shell/xonsh.rs similarity index 100% rename from atuin-config/src/shell/xonsh.rs rename to atuin-dotfiles/src/shell/xonsh.rs diff --git a/atuin-config/src/shell/zsh.rs b/atuin-dotfiles/src/shell/zsh.rs similarity index 100% rename from atuin-config/src/shell/zsh.rs rename to atuin-dotfiles/src/shell/zsh.rs diff --git a/atuin-config/src/store.rs b/atuin-dotfiles/src/store.rs similarity index 100% rename from atuin-config/src/store.rs rename to atuin-dotfiles/src/store.rs diff --git a/atuin/Cargo.toml b/atuin/Cargo.toml index b53a8b5b..3eac0746 100644 --- a/atuin/Cargo.toml +++ b/atuin/Cargo.toml @@ -45,7 +45,7 @@ atuin-server-postgres = { path = "../atuin-server-postgres", version = "18.0.2", atuin-server = { path = "../atuin-server", version = "18.0.2", optional = true } atuin-client = { path = "../atuin-client", version = "18.0.2", optional = true, default-features = false } atuin-common = { path = "../atuin-common", version = "18.0.2" } -atuin-config = { path = "../atuin-config", version = "0.1.0" } +atuin-dotfiles = { path = "../atuin-dotfiles", version = "0.1.0" } log = { workspace = true } env_logger = "0.11.2" diff --git a/atuin/src/command/client.rs b/atuin/src/command/client.rs index ec2a03fb..732df7ff 100644 --- a/atuin/src/command/client.rs +++ b/atuin/src/command/client.rs @@ -12,9 +12,9 @@ mod sync; #[cfg(feature = "sync")] mod account; -mod config; mod default_config; mod doctor; +mod dotfiles; mod history; mod import; mod init; @@ -54,7 +54,7 @@ pub enum Cmd { Store(store::Cmd), #[command(subcommand)] - Config(config::Cmd), + Dotfiles(dotfiles::Cmd), #[command()] Init(init::Cmd), @@ -113,7 +113,7 @@ impl Cmd { Self::Store(store) => store.run(&settings, &db, sqlite_store).await, - Self::Config(config) => config.run(&settings, sqlite_store).await, + Self::Dotfiles(dotfiles) => dotfiles.run(&settings, sqlite_store).await, Self::Init(init) => init.run(&settings).await, diff --git a/atuin/src/command/client/config.rs b/atuin/src/command/client/dotfiles.rs similarity index 100% rename from atuin/src/command/client/config.rs rename to atuin/src/command/client/dotfiles.rs diff --git a/atuin/src/command/client/config/alias.rs b/atuin/src/command/client/dotfiles/alias.rs similarity index 97% rename from atuin/src/command/client/config/alias.rs rename to atuin/src/command/client/dotfiles/alias.rs index 77dc8123..5d067d47 100644 --- a/atuin/src/command/client/config/alias.rs +++ b/atuin/src/command/client/dotfiles/alias.rs @@ -3,7 +3,7 @@ use eyre::{Context, Result}; use atuin_client::{encryption, record::sqlite_store::SqliteStore, settings::Settings}; -use atuin_config::{shell::Alias, store::AliasStore}; +use atuin_dotfiles::{shell::Alias, store::AliasStore}; #[derive(Subcommand, Debug)] #[command(infer_subcommands = true)] diff --git a/atuin/src/command/client/init.rs b/atuin/src/command/client/init.rs index d9bad148..ded6e712 100644 --- a/atuin/src/command/client/init.rs +++ b/atuin/src/command/client/init.rs @@ -1,7 +1,7 @@ use std::path::PathBuf; use atuin_client::{encryption, record::sqlite_store::SqliteStore, settings::Settings}; -use atuin_config::store::AliasStore; +use atuin_dotfiles::store::AliasStore; use clap::{Parser, ValueEnum}; use eyre::{Result, WrapErr}; diff --git a/atuin/src/command/client/init/bash.rs b/atuin/src/command/client/init/bash.rs index ac2bfb00..40f8adc6 100644 --- a/atuin/src/command/client/init/bash.rs +++ b/atuin/src/command/client/init/bash.rs @@ -1,4 +1,4 @@ -use atuin_config::store::AliasStore; +use atuin_dotfiles::store::AliasStore; use eyre::Result; pub async fn init(store: AliasStore, disable_up_arrow: bool, disable_ctrl_r: bool) -> Result<()> { @@ -6,7 +6,7 @@ pub async fn init(store: AliasStore, disable_up_arrow: bool, disable_ctrl_r: boo let aliases = store.aliases().await?; - let aliases = atuin_config::shell::bash::build(&aliases[..]); + let aliases = atuin_dotfiles::shell::bash::build(&aliases[..]); let (bind_ctrl_r, bind_up_arrow) = if std::env::var("ATUIN_NOBIND").is_ok() { (false, false) diff --git a/atuin/src/command/client/init/fish.rs b/atuin/src/command/client/init/fish.rs index 9274b350..01f5d2bd 100644 --- a/atuin/src/command/client/init/fish.rs +++ b/atuin/src/command/client/init/fish.rs @@ -1,4 +1,4 @@ -use atuin_config::store::AliasStore; +use atuin_dotfiles::store::AliasStore; use eyre::Result; pub async fn init(store: AliasStore, disable_up_arrow: bool, disable_ctrl_r: bool) -> Result<()> { @@ -34,7 +34,7 @@ bind -M insert \e\[A _atuin_bind_up"; } let aliases = store.aliases().await?; - let aliases = atuin_config::shell::fish::build(&aliases[..]); + let aliases = atuin_dotfiles::shell::fish::build(&aliases[..]); println!("{aliases}"); diff --git a/atuin/src/command/client/init/xonsh.rs b/atuin/src/command/client/init/xonsh.rs index 4e5929ed..ffac7fec 100644 --- a/atuin/src/command/client/init/xonsh.rs +++ b/atuin/src/command/client/init/xonsh.rs @@ -1,4 +1,4 @@ -use atuin_config::store::AliasStore; +use atuin_dotfiles::store::AliasStore; use eyre::Result; pub async fn init(store: AliasStore, disable_up_arrow: bool, disable_ctrl_r: bool) -> Result<()> { @@ -20,7 +20,7 @@ pub async fn init(store: AliasStore, disable_up_arrow: bool, disable_ctrl_r: boo println!("{base}"); let aliases = store.aliases().await?; - let aliases = atuin_config::shell::xonsh::build(&aliases[..]); + let aliases = atuin_dotfiles::shell::xonsh::build(&aliases[..]); println!("{aliases}"); diff --git a/atuin/src/command/client/init/zsh.rs b/atuin/src/command/client/init/zsh.rs index 9044c835..9c4dbe43 100644 --- a/atuin/src/command/client/init/zsh.rs +++ b/atuin/src/command/client/init/zsh.rs @@ -1,4 +1,4 @@ -use atuin_config::store::AliasStore; +use atuin_dotfiles::store::AliasStore; use eyre::Result; pub async fn init(store: AliasStore, disable_up_arrow: bool, disable_ctrl_r: bool) -> Result<()> { @@ -28,7 +28,7 @@ bindkey -M vicmd 'k' atuin-up-search-vicmd"; } let aliases = store.aliases().await?; - let aliases = atuin_config::shell::zsh::build(&aliases[..]); + let aliases = atuin_dotfiles::shell::zsh::build(&aliases[..]); println!("{aliases}");