tools: Announce refs on push
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
This commit is contained in:
parent
c991c0eea0
commit
a20d16fc31
|
|
@ -1,6 +1,6 @@
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
use radicle::storage::WriteStorage;
|
use radicle::{node::Handle, storage::WriteStorage};
|
||||||
|
|
||||||
fn main() -> anyhow::Result<()> {
|
fn main() -> anyhow::Result<()> {
|
||||||
let cwd = Path::new(".").canonicalize()?;
|
let cwd = Path::new(".").canonicalize()?;
|
||||||
|
|
@ -13,6 +13,8 @@ fn main() -> anyhow::Result<()> {
|
||||||
|
|
||||||
let project = profile.storage.repository(&id)?;
|
let project = profile.storage.repository(&id)?;
|
||||||
let sigrefs = profile.storage.sign_refs(&project, &profile.signer)?;
|
let sigrefs = profile.storage.sign_refs(&project, &profile.signer)?;
|
||||||
|
profile.node()?.announce_refs(&id)?;
|
||||||
|
|
||||||
println!("ok: {}", sigrefs.signature);
|
println!("ok: {}", sigrefs.signature);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ pub struct Profile {
|
||||||
pub home: PathBuf,
|
pub home: PathBuf,
|
||||||
pub signer: UnsafeSigner,
|
pub signer: UnsafeSigner,
|
||||||
pub storage: Storage,
|
pub storage: Storage,
|
||||||
pub node: Option<node::Connection>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Profile {
|
impl Profile {
|
||||||
|
|
@ -59,7 +58,6 @@ impl Profile {
|
||||||
home,
|
home,
|
||||||
signer,
|
signer,
|
||||||
storage,
|
storage,
|
||||||
node: None,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -73,16 +71,12 @@ impl Profile {
|
||||||
home,
|
home,
|
||||||
signer,
|
signer,
|
||||||
storage,
|
storage,
|
||||||
node: None,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Connect to the local radicle node.
|
/// Return a connection to the locally running node.
|
||||||
pub fn connect(&mut self) -> Result<(), io::Error> {
|
pub fn node(&self) -> Result<node::Connection, io::Error> {
|
||||||
let conn = node::Connection::connect(self.socket())?;
|
node::Connection::connect(self.socket())
|
||||||
self.node = Some(conn);
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn id(&self) -> &PublicKey {
|
pub fn id(&self) -> &PublicKey {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue