Skip to content

Commit

Permalink
fix(command): don't need command in function name
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleygwilliams committed Apr 13, 2018
1 parent 0f01272 commit 3a62a6f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -73,15 +73,15 @@ 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);
println!("🎒 packed up your package!");
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);
Expand Down
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
}
});

0 comments on commit 3a62a6f

Please sign in to comment.