Skip to content

Commit

Permalink
Merge pull request #550 from rustwasm/install-1
Browse files Browse the repository at this point in the history
fix(exe): wasm-pack-init (1).exe should work
  • Loading branch information
ashleygwilliams authored Feb 28, 2019
2 parents 0f331e0 + f26ccc0 commit 70dba37
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down

0 comments on commit 70dba37

Please sign in to comment.