fix(command): don't need command in function name

master
Ashley Williams 7 years ago
parent 0f0127255b
commit 3a62a6f34a
  1. 6
      src/command.rs
  2. 8
      src/main.rs

@ -46,7 +46,7 @@ pub fn create_pkg_dir(path: &str) -> result::Result<(), Error> {
Ok(())
}
pub fn init_command(path: Option<String>, scope: Option<String>) -> result::Result<(), Error> {
pub fn init(path: Option<String>, scope: Option<String>) -> result::Result<(), Error> {
let started = Instant::now();
let crate_path = set_crate_path(path);
@ -73,7 +73,7 @@ pub fn init_command(path: Option<String>, scope: Option<String>) -> result::Resu
Ok(())
}
pub fn pack_command(path: Option<String>) -> result::Result<(), Error> {
pub fn pack(path: Option<String>) -> result::Result<(), Error> {
let crate_path = set_crate_path(path);
npm::npm_pack(&crate_path);
@ -81,7 +81,7 @@ pub fn pack_command(path: Option<String>) -> result::Result<(), Error> {
Ok(())
}
pub fn publish_command(path: Option<String>) -> result::Result<(), Error> {
pub fn publish(path: Option<String>) -> result::Result<(), Error> {
let crate_path = set_crate_path(path);
npm::npm_publish(&crate_path);

@ -6,16 +6,16 @@ extern crate quicli;
use quicli::prelude::*;
use wasm_pack::Cli;
use wasm_pack::command::{init_command, pack_command, publish_command, Command};
use wasm_pack::command::{init, pack, publish, Command};
main!(|args: Cli, log_level: verbosity| match args.cmd {
Command::Init { path, scope } => {
init_command(path, scope)?;
init(path, scope)?;
}
Command::Pack { path } => {
pack_command(path)?;
pack(path)?;
}
Command::Publish { path } => {
publish_command(path)?;
publish(path)?;
}
});

Loading…
Cancel
Save