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

@@ -31,7 +31,7 @@ use tokio_compat_02::FutureExt;
// pub use v0_2_12::Version as Current;
pub type Current = ();
use crate::context::{CliContext, EitherContext, RpcContext};
use crate::context::{CliContext, RpcContext};
use crate::util::{to_yaml_async_writer, AsyncCompat};
use crate::{Error, ResultExt as _};
@@ -180,7 +180,7 @@ pub async fn self_update(requirement: emver::VersionRange) -> Result<(), Error>
}
#[command(rename = "git-info", local)]
pub fn git_info(#[context] _ctx: EitherContext) -> Result<String, Error> {
pub fn git_info() -> Result<String, Error> {
Ok(
git_version::git_version!(args = ["--always", "--abbrev=40", "--dirty=-modified"])
.to_owned(),

View File

@@ -1,21 +0,0 @@
use super::*;
const V0_2_14: emver::Version = emver::Version::new(0, 2, 14, 0);
pub struct Version;
#[async_trait]
impl VersionT for Version {
type Previous = v0_2_13::Version;
fn new() -> Self {
Version
}
fn semver(&self) -> &'static emver::Version {
&V0_2_14
}
async fn up(&self) -> Result<(), Error> {
Ok(())
}
async fn down(&self) -> Result<(), Error> {
Ok(())
}
}