From 87f26a82b6110dd8a826fd35a0b91b80e8375a7c Mon Sep 17 00:00:00 2001 From: Michal Budzynski Date: Mon, 22 May 2017 17:06:38 +0200 Subject: [PATCH] Fix for different naming of nodejs on ubuntu also added static lifetime to str constants as these were failing on nightly windows --- build.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build.rs b/build.rs index 9e552a92..9d45b3de 100644 --- a/build.rs +++ b/build.rs @@ -8,13 +8,13 @@ extern crate error_chain; #[cfg(windows)] mod execs { - pub const NPM: &str = "npm.cmd"; - pub const STYLUS: &str = "stylus.cmd"; + pub const NPM: &'static str = "npm.cmd"; + pub const STYLUS: &'static str = "stylus.cmd"; } #[cfg(not(windows))] mod execs { - pub const NPM: &str = "npm"; - pub const STYLUS: &str = "stylus"; + pub const NPM: &'static str = "npm"; + pub const STYLUS: &'static str = "stylus"; } @@ -68,7 +68,7 @@ fn run() -> Result<()> { if let Ok(_) = env::var("CARGO_FEATURE_REGENERATE_CSS") { // Check dependencies Program(execs::NPM).exists()?; - Program("node").exists()?; + Program("node").exists().or(Program("nodejs").exists())?; Package("nib").exists()?; Package("stylus").exists()?;