Skip to content

Commit

Permalink
select build target
Browse files Browse the repository at this point in the history
  • Loading branch information
csmoe committed Dec 28, 2018
1 parent 95268cd commit 1f0d51b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/command/publish/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub mod access;
use self::access::Access;
use command::build::{Build, BuildOptions};
use command::utils::{find_pkg_directory, set_crate_path};
use dialoguer::{Confirmation, Input};
use dialoguer::{Confirmation, Input, Select};
use failure::Error;
use npm;
use slog::Logger;
Expand All @@ -15,7 +15,7 @@ use PBAR;
/// Creates a tarball from a 'pkg' directory
/// and publishes it to the NPM registry
pub fn publish(
target: String,
_target: String,
path: Option<PathBuf>,
access: Option<Access>,
log: &Logger,
Expand All @@ -31,18 +31,18 @@ pub fn publish(
// while `wasm-pack publish`, if the pkg directory cannot be found,
// then try to `wasm-pack build`
if Confirmation::new()
.with_text("Your npm package hasn't be built, build it?")
.with_text("Your package hasn't built, build it?")
.interact()?
{
let out_dir = Input::new()
.with_prompt("out_dir")
.with_prompt("out_dir[default: pkg]")
.default("pkg".to_string())
.show_default(true)
.show_default(false)
.interact()?;
let target = Input::new()
.with_prompt("target")
.default(target)
.show_default(true)
let target = Select::new()
.with_prompt("target[default: browser]")
.items(&["browser", "nodejs", "no-modules"])
.default(0)
.interact()?
.to_string();
let build_opts = BuildOptions {
Expand Down

0 comments on commit 1f0d51b

Please sign in to comment.