diff --git a/Cargo.toml b/Cargo.toml index af82ece..0b0bb5d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ derive_more = "0.99.17" ed25519-dalek = { version = "2.1.1", features = ["rand_core", "pem"] } futures = "0.3.30" include_dir = { version = "0.7.4", features = ["nightly"] } -rrr = { git = "https://github.com/recursive-record-registry/rrr.git", rev = "f2dfeeba77a386d05a7182584a32c508aa831567" } +rrr = { git = "https://github.com/recursive-record-registry/rrr.git", rev = "8c1a37007cbded8c144b6ff566656b104a7d0add" } serde = { version = "1.0.203", features = ["derive"] } serde_bytes = "0.11.14" serde_with = "3.8.1" diff --git a/src/cmd/mod.rs b/src/cmd/mod.rs index d812eea..9a7ad13 100644 --- a/src/cmd/mod.rs +++ b/src/cmd/mod.rs @@ -36,7 +36,7 @@ pub enum Command { impl Command { pub async fn process(self) -> Result<()> { - match Command::parse() { + match self { Command::New { directory, force } => { OwnedRegistry::generate(&directory, force).await.unwrap(); println!("New registry successfully generated in {directory:?}."); diff --git a/tests/test.rs b/tests/test.rs index c55f1b5..5d6c3f9 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -26,3 +26,27 @@ async fn owned_registry() { .successive_records .is_empty()); } + +#[cfg(feature = "cmd")] +#[tokio::test] +#[traced_test] +async fn new_registry() { + use rrr_make::cmd::Command; + + let registry_dir = tempdir().unwrap(); + Command::New { + directory: registry_dir.path().into(), + force: false, + } + .process() + .await + .unwrap(); + Command::Make { + input_directory: registry_dir.path().into(), + publish: false, + force: false, + } + .process() + .await + .unwrap(); +}