From 8199f1a679421a3405ace137c3796395c1a903f0 Mon Sep 17 00:00:00 2001 From: cloudhead Date: Sat, 2 Sep 2023 20:41:14 +0200 Subject: [PATCH] cli: Add `rad publish` command This command publishes a private repo. --- radicle-cli/src/commands.rs | 2 + radicle-cli/src/commands/publish.rs | 137 ++++++++++++++++++++++++++++ radicle-cli/src/main.rs | 7 ++ 3 files changed, 146 insertions(+) create mode 100644 radicle-cli/src/commands/publish.rs diff --git a/radicle-cli/src/commands.rs b/radicle-cli/src/commands.rs index 2fc5d6ea..7a368f39 100644 --- a/radicle-cli/src/commands.rs +++ b/radicle-cli/src/commands.rs @@ -36,6 +36,8 @@ pub mod rad_node; pub mod rad_patch; #[path = "commands/path.rs"] pub mod rad_path; +#[path = "commands/publish.rs"] +pub mod rad_publish; #[path = "commands/remote.rs"] pub mod rad_remote; #[path = "commands/review.rs"] diff --git a/radicle-cli/src/commands/publish.rs b/radicle-cli/src/commands/publish.rs new file mode 100644 index 00000000..e8c5eea1 --- /dev/null +++ b/radicle-cli/src/commands/publish.rs @@ -0,0 +1,137 @@ +use std::ffi::OsString; + +use anyhow::{anyhow, Context as _}; + +use radicle::identity::Visibility; +use radicle::node::Handle as _; +use radicle::prelude::Id; +use radicle::storage::{ReadRepository, SignRepository, WriteRepository, WriteStorage}; + +use crate::terminal as term; +use crate::terminal::args::{Args, Error, Help}; + +pub const HELP: Help = Help { + name: "publish", + description: "Publish a repository to the network", + version: env!("CARGO_PKG_VERSION"), + usage: r#" +Usage + + rad publish [] [