mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-23 18:21:38 +03:00
Merge pull request #14 from AleoHQ/skeleton/cli
Adds skeleton CLI for `leo deploy`
This commit is contained in:
commit
9d67019cac
41
leo/commands/deploy.rs
Normal file
41
leo/commands/deploy.rs
Normal file
@ -0,0 +1,41 @@
|
||||
use crate::{cli::*, cli_types::*};
|
||||
use crate::commands::BuildCommand;
|
||||
use crate::errors::CLIError;
|
||||
use crate::files::Manifest;
|
||||
|
||||
use clap::ArgMatches;
|
||||
use std::convert::TryFrom;
|
||||
use std::env::current_dir;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct DeployCommand;
|
||||
|
||||
impl CLI for DeployCommand {
|
||||
type Options = ();
|
||||
type Output = ();
|
||||
|
||||
const NAME: NameType = "deploy";
|
||||
const ABOUT: AboutType = "Deploy package as program to the network (*)";
|
||||
const ARGUMENTS: &'static [ArgumentType] = &[];
|
||||
const FLAGS: &'static [FlagType] = &[];
|
||||
const OPTIONS: &'static [OptionType] = &[];
|
||||
const SUBCOMMANDS: &'static [SubCommandType] = &[];
|
||||
|
||||
#[cfg_attr(tarpaulin, skip)]
|
||||
fn parse(_arguments: &ArgMatches) -> Result<Self::Options, CLIError> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg_attr(tarpaulin, skip)]
|
||||
fn output(options: Self::Options) -> Result<Self::Output, CLIError> {
|
||||
let (_program, _checksum_differs) = BuildCommand::output(options)?;
|
||||
|
||||
// Get the package name
|
||||
let path = current_dir()?;
|
||||
let _package_name = Manifest::try_from(&path)?.get_package_name();
|
||||
|
||||
log::info!("Unimplemented - `leo deploy`");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
@ -1,6 +1,9 @@
|
||||
pub mod build;
|
||||
pub use self::build::*;
|
||||
|
||||
pub mod deploy;
|
||||
pub use self::deploy::*;
|
||||
|
||||
pub mod init;
|
||||
pub use self::init::*;
|
||||
|
||||
|
@ -15,7 +15,7 @@ impl CLI for PublishCommand {
|
||||
type Output = ();
|
||||
|
||||
const NAME: NameType = "publish";
|
||||
const ABOUT: AboutType = "Package circuit and upload this package to the registry";
|
||||
const ABOUT: AboutType = "Package circuit and upload this package to the registry (*)";
|
||||
const ARGUMENTS: &'static [ArgumentType] = &[];
|
||||
const FLAGS: &'static [FlagType] = &[];
|
||||
const OPTIONS: &'static [OptionType] = &[];
|
||||
|
@ -26,6 +26,7 @@ fn main() -> Result<(), CLIError> {
|
||||
ProveCommand::new(),
|
||||
RunCommand::new(),
|
||||
PublishCommand::new(),
|
||||
DeployCommand::new(),
|
||||
])
|
||||
.set_term_width(0)
|
||||
.get_matches();
|
||||
@ -47,6 +48,7 @@ fn main() -> Result<(), CLIError> {
|
||||
}
|
||||
("run", Some(arguments)) => RunCommand::output(RunCommand::parse(arguments)?),
|
||||
("publish", Some(arguments)) => PublishCommand::output(PublishCommand::parse(arguments)?),
|
||||
("deploy", Some(arguments)) => DeployCommand::output(DeployCommand::parse(arguments)?),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user