Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assorted nits #80

Merged
merged 2 commits into from
Apr 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bindgen.rs
Original file line number Diff line number Diff line change
@@ -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!(
Expand Down
2 changes: 1 addition & 1 deletion src/build.rs
Original file line number Diff line number Diff line change
@@ -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!(
Expand Down
8 changes: 4 additions & 4 deletions src/command.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use PBAR;
use bindgen;
use build;
use console::style;
Expand All @@ -12,6 +11,7 @@ use readme;
use std::fs;
use std::result;
use std::time::Instant;
use PBAR;

#[derive(Debug, StructOpt)]
pub enum Command {
Expand Down 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 @@ -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)?;
}
});
2 changes: 1 addition & 1 deletion src/manifest.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/readme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down