install -> fetch

This commit is contained in:
damirka 2021-07-13 13:41:38 +03:00
parent e5be6e2c57
commit 87af0609b7
3 changed files with 10 additions and 10 deletions

View File

@ -27,15 +27,15 @@ use tracing::span::Span;
/// Install dependencies Leo code command
#[derive(StructOpt, Debug)]
#[structopt(setting = structopt::clap::AppSettings::ColoredHelp)]
pub struct Install {}
pub struct Fetch {}
impl Command for Install {
impl Command for Fetch {
/// Names of dependencies in the current branch of a dependency tree.
type Input = IndexSet<String>;
type Output = ();
fn log_span(&self) -> Span {
tracing::span!(tracing::Level::INFO, "Installing")
tracing::span!(tracing::Level::INFO, "Fetching")
}
fn prelude(&self, context: Context) -> Result<Self::Input> {
@ -88,7 +88,7 @@ impl Command for Install {
// Run the same command for installed dependency.
let mut new_context = context.clone();
new_context.path = Some(path);
(Install {}).apply(new_context, tree.clone())?;
(Fetch {}).apply(new_context, tree.clone())?;
}
Ok(())

View File

@ -20,8 +20,8 @@ pub use add::Add;
pub mod clone;
pub use clone::Clone;
pub mod install;
pub use install::Install;
pub mod fetch;
pub use fetch::Fetch;
pub mod login;
pub use login::Login;

View File

@ -22,7 +22,7 @@ pub mod logger;
pub mod updater;
use commands::{
package::{Add, Clone, Install, Login, Logout, Publish, Remove},
package::{Add, Clone, Fetch, Login, Logout, Publish, Remove},
Build,
Clean,
Command,
@ -138,9 +138,9 @@ enum CommandOpts {
},
#[structopt(about = "Install dependencies for this program")]
Install {
Fetch {
#[structopt(flatten)]
command: Install,
command: Fetch,
},
#[structopt(about = "Clone a package from the Aleo Package Manager")]
@ -220,7 +220,7 @@ fn run_with_args(opt: Opt) -> Result<(), Error> {
CommandOpts::Update { command } => command.try_execute(context),
CommandOpts::Add { command } => command.try_execute(context),
CommandOpts::Install { command } => command.try_execute(context),
CommandOpts::Fetch { command } => command.try_execute(context),
CommandOpts::Clone { command } => command.try_execute(context),
CommandOpts::Login { command } => command.try_execute(context),
CommandOpts::Logout { command } => command.try_execute(context),