Skip to content

Commit

Permalink
fix(cli): build freezing on Windows, closes #3399 (#3402)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Feb 11, 2022
1 parent def7684 commit 8beab63
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changes/fix-cli.js-windows-freezing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"cli.rs": patch
"cli.js": patch
---

Fixes CLI freezing when running `light.exe` on Windows without the `--verbose` flag.
4 changes: 3 additions & 1 deletion tooling/bundler/src/bundle/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::{
fs::{self, File},
io::{self, BufWriter, Write},
path::Path,
process::Command,
process::{Command, Stdio},
};
use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor};

Expand Down Expand Up @@ -198,6 +198,8 @@ pub fn print_info(message: &str) -> crate::Result<()> {
pub fn execute_with_verbosity(cmd: &mut Command, settings: &Settings) -> crate::Result<()> {
if settings.is_verbose() {
cmd.pipe()?;
} else {
cmd.stdout(Stdio::null()).stderr(Stdio::null());
}
let status = cmd.status().expect("failed to spawn command");

Expand Down
5 changes: 1 addition & 4 deletions tooling/bundler/src/bundle/windows/msi/wix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,7 @@ fn run_light(
}

let mut cmd = Command::new(&light_exe);
cmd
.args(&args)
.stdout(Stdio::piped())
.current_dir(build_path);
cmd.args(&args).current_dir(build_path);

common::execute_with_verbosity(&mut cmd, settings).map_err(|_| {
crate::Error::ShellScriptError(format!(
Expand Down

0 comments on commit 8beab63

Please sign in to comment.