Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
Post rebase fixes
Christopher Fredén committed 2 years ago
commit 82fc9ca6a9a82cfe54d2ad5f01225316e823bec2
parent 195bae992f9ac5adc8f5e0554443f0bda2489a48
2 files changed +8 -9
modified radicle-cli/src/commands/issue.rs
@@ -496,8 +496,8 @@ pub fn run(args: IssueArgs, ctx: impl term::Context) -> anyhow::Result<()> {

        match command {
            IssueCommands::Delete { id } => {
-
                let signer = term::signer(&profile)?;
                let id = id.resolve(&repo.backend)?;
+
                let signer = term::signer(&profile)?;
                issues.remove(&id, &signer)?;
            }
            IssueCommands::Edit {
@@ -535,13 +535,12 @@ pub fn run(args: IssueArgs, ctx: impl term::Context) -> anyhow::Result<()> {
                }
            }
            IssueCommands::State(state_args) => {
-
                let signer = term::signer(&profile)?;
                let id = state_args.id.resolve(&repo.backend)?;
+
                let signer = term::signer(&profile)?;
                let mut issue = issues.get_mut(&id)?;
                issue.lifecycle(to_state(state_args), &signer)?;
            }
            IssueCommands::Assign { id, add, delete } => {
-
                let signer = term::signer(&profile)?;
                let id = id.resolve(&repo.backend)?;
                let Ok(mut issue) = issues.get_mut(&id) else {
                    anyhow::bail!("Issue `{id}` not found");
@@ -552,6 +551,7 @@ pub fn run(args: IssueArgs, ctx: impl term::Context) -> anyhow::Result<()> {
                    .chain(add.iter())
                    .cloned()
                    .collect::<Vec<_>>();
+
                let signer = term::signer(&profile)?;
                issue.assign(assignees, &signer)?;
            }
            IssueCommands::Comment {
@@ -559,10 +559,10 @@ pub fn run(args: IssueArgs, ctx: impl term::Context) -> anyhow::Result<()> {
                message,
                reply_to,
            } => {
-
                let signer = term::signer(&profile)?;
                let issue_id = id.resolve::<cob::ObjectId>(&repo.backend)?;
                let mut issue = issues.get_mut(&issue_id)?;
                let (body, reply_to) = prompt_comment(message, reply_to, &issue, &repo)?;
+
                let signer = term::signer(&profile)?;
                let comment_id = issue.comment(body, reply_to, vec![], &signer)?;

                if args.quiet {
@@ -577,19 +577,17 @@ pub fn run(args: IssueArgs, ctx: impl term::Context) -> anyhow::Result<()> {
                comment_id,
                reaction,
            } => {
-
                let signer = term::signer(&profile)?;
                let id = id.resolve(&repo.backend)?;
                if let Ok(mut issue) = issues.get_mut(&id) {
-
                    let signer = term::signer(&profile)?;
                    let comment_id = comment_id.unwrap_or_else(|| {
                        let (comment_id, _) = term::io::comment_select(&issue).unwrap();
                        *comment_id
                    });
+
                    let signer = term::signer(&profile)?;
                    issue.react(comment_id, reaction, true, &signer)?;
                }
            }
            IssueCommands::Label { id, add, delete } => {
-
                let signer = term::signer(&profile)?;
                let id = id.resolve(&repo.backend)?;
                let Ok(mut issue) = issues.get_mut(&id) else {
                    anyhow::bail!("Issue `{id}` not found");
@@ -600,6 +598,7 @@ pub fn run(args: IssueArgs, ctx: impl term::Context) -> anyhow::Result<()> {
                    .chain(add.iter())
                    .cloned()
                    .collect::<Vec<_>>();
+
                let signer = term::signer(&profile)?;
                issue.label(labels, &signer)?;
            }
            IssueCommands::Open {
modified radicle-cli/src/main.rs
@@ -8,7 +8,7 @@ use clap::builder::Styles;
use clap::{CommandFactory, FromArgMatches as _, Parser, Subcommand};

use clap_complete::dynamic::shells::CompleteCommand;
-
use radicle::version;
+
use radicle::version::Version;
use radicle_cli::commands::rad_issue;
use radicle_cli::commands::*;
use radicle_cli::terminal as term;
@@ -40,7 +40,7 @@ Usage: {usage}
/// Radicle is a distributed GIT forge.
#[derive(Parser, Debug)]
#[command(name = NAME)]
-
#[command(version = VERSION)]
+
#[command(version = PKG_VERSION)]
#[command(long_version = LONG_VERSION)]
#[command(help_template = HELP_TEMPLATE)]
#[command(propagate_version = true)]