fix(exe): wasm-pack-init (1).exe should work

master
Ashley Williams 6 years ago
parent 173a05bd82
commit f26ccc0f3a
  1. 7
      src/main.rs

@ -35,7 +35,12 @@ fn run() -> Result<(), failure::Error> {
if let Ok(me) = env::current_exe() {
// If we're actually running as the installer then execute our
// self-installation, otherwise just continue as usual.
if me.file_stem().and_then(|s| s.to_str()) == Some("wasm-pack-init") {
if me
.file_stem()
.and_then(|s| s.to_str())
.expect("executable should have a filename")
.starts_with("wasm-pack-init")
{
installer::install();
}
}

Loading…
Cancel
Save