diff --git a/src/bindgen.rs b/src/bindgen.rs index af8e17c..19cafeb 100644 --- a/src/bindgen.rs +++ b/src/bindgen.rs @@ -1,7 +1,7 @@ -use PBAR; use console::style; use emoji; use std::process::Command; +use PBAR; pub fn cargo_install_wasm_bindgen() { let step = format!( diff --git a/src/build.rs b/src/build.rs index f6953a5..aa3b807 100644 --- a/src/build.rs +++ b/src/build.rs @@ -1,7 +1,7 @@ -use PBAR; use console::style; use emoji; use std::process::Command; +use PBAR; pub fn rustup_add_wasm_target() { let step = format!( diff --git a/src/command.rs b/src/command.rs index 0462520..0abde7b 100644 --- a/src/command.rs +++ b/src/command.rs @@ -1,4 +1,3 @@ -use PBAR; use bindgen; use build; use console::style; @@ -12,6 +11,7 @@ use readme; use std::fs; use std::result; use std::time::Instant; +use PBAR; #[derive(Debug, StructOpt)] pub enum Command { @@ -46,7 +46,7 @@ pub fn create_pkg_dir(path: &str) -> result::Result<(), Error> { Ok(()) } -pub fn init_command(path: Option, scope: Option) -> result::Result<(), Error> { +pub fn init(path: Option, scope: Option) -> result::Result<(), Error> { let started = Instant::now(); let crate_path = set_crate_path(path); @@ -73,7 +73,7 @@ pub fn init_command(path: Option, scope: Option) -> result::Resu Ok(()) } -pub fn pack_command(path: Option) -> result::Result<(), Error> { +pub fn pack(path: Option) -> 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) -> result::Result<(), Error> { Ok(()) } -pub fn publish_command(path: Option) -> result::Result<(), Error> { +pub fn publish(path: Option) -> result::Result<(), Error> { let crate_path = set_crate_path(path); npm::npm_publish(&crate_path); diff --git a/src/main.rs b/src/main.rs index afc7355..2b4caa0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,17 +5,17 @@ extern crate indicatif; extern crate quicli; use quicli::prelude::*; +use wasm_pack::command::{init, pack, publish, Command}; use wasm_pack::Cli; -use wasm_pack::command::{init_command, pack_command, publish_command, 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)?; } }); diff --git a/src/manifest.rs b/src/manifest.rs index c60583a..b7a6fb7 100644 --- a/src/manifest.rs +++ b/src/manifest.rs @@ -1,12 +1,12 @@ use std::fs::File; use std::io::prelude::*; -use PBAR; use console::style; use emoji; use failure::Error; use serde_json; use toml; +use PBAR; #[derive(Deserialize)] struct CargoManifest { diff --git a/src/readme.rs b/src/readme.rs index b050306..fa9d4d3 100644 --- a/src/readme.rs +++ b/src/readme.rs @@ -2,8 +2,8 @@ use console::style; use failure::Error; use std::fs; -use PBAR; use emoji; +use PBAR; pub fn copy_from_crate(path: &str) -> Result<(), Error> { let step = format!(