From 92ced5015b4b9764a406985c94cc61bc1da48521 Mon Sep 17 00:00:00 2001 From: Alexander Korolev Date: Thu, 30 Jul 2020 22:48:16 +0200 Subject: [PATCH 1/4] use cmd /c npm.cmd instead of just npm.cmd on windows --- src/impl.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/impl.rs b/src/impl.rs index 2b2e5db..c31edf9 100644 --- a/src/impl.rs +++ b/src/impl.rs @@ -554,7 +554,8 @@ impl NpmBuild { /// Executes `npm install`. pub fn install(self) -> io::Result { - if let Err(e) = Command::new(&self.executable) + if let Err(e) = self + .command() .arg("install") .current_dir(&self.package_json_dir) .status() @@ -568,7 +569,8 @@ impl NpmBuild { /// Executes `npm run CMD`. pub fn run(self, cmd: &str) -> io::Result { - if let Err(e) = Command::new(&self.executable) + if let Err(e) = self + .command() .arg("run") .arg(cmd) .current_dir(&self.package_json_dir) @@ -591,6 +593,16 @@ impl NpmBuild { pub fn to_resource_dir(self) -> ResourceDir { self.into() } + + #[cfg(not(windows))] + fn command(&self) -> Command { + Command::new(&self.executable) + } + + #[cfg(windows)] + fn command(&self) -> Command { + Command::new("cmd").arg("/c").arg(&self.executable) + } } impl From for ResourceDir { From 8ffae5fbf796a1d2ea76759acb5e71a435e55395 Mon Sep 17 00:00:00 2001 From: Alexander Korolev Date: Fri, 31 Jul 2020 16:05:08 +0200 Subject: [PATCH 2/4] fixed compilation issue --- src/impl.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/impl.rs b/src/impl.rs index c31edf9..f1dbb17 100644 --- a/src/impl.rs +++ b/src/impl.rs @@ -601,7 +601,11 @@ impl NpmBuild { #[cfg(windows)] fn command(&self) -> Command { - Command::new("cmd").arg("/c").arg(&self.executable) + let mut cmd = Command::new("cmd"); + + cmd.arg("/c").arg(&self.executable); + + cmd } } From 275c3c3e7aebf40bccf1b4728e7aa3003c268b58 Mon Sep 17 00:00:00 2001 From: Alexander Korolev Date: Fri, 31 Jul 2020 18:18:37 +0200 Subject: [PATCH 3/4] try to tweak github actions --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fec17ad..9c86bf6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -5,7 +5,7 @@ on: [push] jobs: build: - runs-on: ubuntu-latest + runs-on: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v1 From b3f1f1cd4bd2b07f29e59d279fee6f898b3c4ff1 Mon Sep 17 00:00:00 2001 From: Alexander Korolev Date: Fri, 31 Jul 2020 18:20:17 +0200 Subject: [PATCH 4/4] try to tweak github actions --- .github/workflows/rust.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9c86bf6..040e3c2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -5,7 +5,10 @@ on: [push] jobs: build: - runs-on: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v1