Skip to content

Commit

Permalink
bootstrap: Change unwrap() to expect() for WIX path
Browse files Browse the repository at this point in the history
On Windows, `x.py dist` command panics without proper error message if 'WIX' environment variable is not set. This patch changes `Option::unwrap()` to `Option::expect()`.
  • Loading branch information
itzurabhi authored Dec 11, 2021
1 parent b8dc6aa commit b9ae04f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,9 @@ impl Step for Extended {
builder.install(&etc.join("gfx/rust-logo.ico"), &exe, 0o644);

// Generate msi installer
let wix = PathBuf::from(env::var_os("WIX").unwrap());
let wix_path = env::var_os("WIX")
.expect("`WIX` environment variable must be set for generating MSI installer(s).");
let wix = PathBuf::from(wix_path);
let heat = wix.join("bin/heat.exe");
let candle = wix.join("bin/candle.exe");
let light = wix.join("bin/light.exe");
Expand Down

0 comments on commit b9ae04f

Please sign in to comment.