diff --git a/radicle-cli/src/commands/clone.rs b/radicle-cli/src/commands/clone.rs index 2284cb41..68bea8c4 100644 --- a/radicle-cli/src/commands/clone.rs +++ b/radicle-cli/src/commands/clone.rs @@ -133,7 +133,6 @@ impl Args for Options { pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> { let profile = ctx.profile()?; - let signer = term::signer(&profile)?; let mut node = radicle::Node::new(profile.socket()); if !node.is_running() { @@ -148,7 +147,6 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> { options.scope, options.sync.with_profile(&profile), &mut node, - &signer, &profile, )?; let delegates = doc @@ -229,16 +227,15 @@ pub enum CloneError { Fetch(#[from] sync::FetchError), } -pub fn clone( +pub fn clone( id: RepoId, directory: Option, scope: Scope, settings: SyncSettings, node: &mut Node, - signer: &G, profile: &Profile, ) -> Result<(raw::Repository, storage::git::Repository, Doc, Project), CloneError> { - let me = *signer.public_key(); + let me = profile.id(); // Seed repository. if node.seed(id, scope)? { @@ -283,7 +280,7 @@ pub fn clone( "Creating checkout in ./{}..", term::format::tertiary(path.display()) )); - let working = rad::checkout(id, &me, path, &profile.storage)?; + let working = rad::checkout(id, me, path, &profile.storage)?; spinner.finish(); diff --git a/radicle-cli/src/commands/job.rs b/radicle-cli/src/commands/job.rs index ab1bfdc5..365a19e2 100644 --- a/radicle-cli/src/commands/job.rs +++ b/radicle-cli/src/commands/job.rs @@ -205,7 +205,6 @@ impl Args for Options { pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> { let profile = ctx.profile()?; - let signer = term::signer(&profile)?; let (_, rid) = radicle::rad::cwd()?; let repo = profile.storage.repository_mut(rid)?; let announce = options.announce @@ -222,6 +221,7 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> { match options.op { Operation::Trigger { commit } => { + let signer = term::signer(&profile)?; trigger(&commit, &mut ci_store, &repo, &signer, options.quiet)?; } Operation::Start { @@ -229,6 +229,7 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> { run_id, info_url, } => { + let signer = term::signer(&profile)?; start(&job_id, &run_id, info_url, &mut ci_store, &repo, &signer)?; } Operation::List => { @@ -238,9 +239,11 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> { show(&job_id, &ci_store, &repo)?; } Operation::Finish { job_id, reason } => { + let signer = term::signer(&profile)?; finish(&job_id, reason, &mut ci_store, &repo, &signer)?; } Operation::Delete { job_id } => { + let signer = term::signer(&profile)?; let job_id = job_id.resolve(&repo.backend)?; ci_store.remove(&job_id, &signer)?; }