overhaul context

This commit is contained in:
Aiden McClelland
2021-08-31 19:16:29 -06:00
committed by Aiden McClelland
parent 7b9ce88a16
commit 9fb02c6a1e
16 changed files with 126 additions and 258 deletions

View File

@@ -5,13 +5,12 @@ use std::path::Path;
use ed25519_dalek::Keypair;
use rpc_toolkit::command;
use crate::context::EitherContext;
use crate::context::CliContext;
use crate::util::display_none;
use crate::{Error, ResultExt};
#[command(cli_only, blocking, display(display_none))]
pub fn init(#[context] ctx: EitherContext) -> Result<(), Error> {
let ctx = ctx.as_cli().unwrap();
pub fn init(#[context] ctx: CliContext) -> Result<(), Error> {
if !ctx.developer_key_path.exists() {
let parent = ctx.developer_key_path.parent().unwrap_or(Path::new("/"));
if !parent.exists() {