allow build to run on windows as well
This commit is contained in:
		| @@ -4,8 +4,8 @@ target = "xtensa-esp32-espidf" | ||||
| [target.xtensa-esp32-espidf] | ||||
| linker = "ldproxy" | ||||
| #runner = "espflash flash --monitor --partition-table partitions.csv" # Select this runner for espflash v2.x.x | ||||
| runner = "espflash flash --monitor --baud 921600 --partition-table partitions.csv" # Select this runner for espflash v2.x.x | ||||
| #runner = "cargo runner" | ||||
| #runner = "espflash flash --monitor --baud 921600 --partition-table partitions.csv" # Select this runner for espflash v2.x.x | ||||
| runner = "cargo runner" | ||||
| rustflags = [ "--cfg",  "espidf_time64"] # Extending time_t for ESP IDF 5: https://github.com/esp-rs/rust/issues/110 | ||||
|  | ||||
| [unstable] | ||||
|   | ||||
| @@ -6,19 +6,39 @@ fn main() { | ||||
|     Command::new("rm") | ||||
|         .arg("./src/webserver/bundle.js") | ||||
|         .output() | ||||
|         .expect("failed to execute process"); | ||||
|         .unwrap(); | ||||
|  | ||||
|     let output = Command::new("npx") | ||||
|     match Command::new("cmd").spawn() { | ||||
|         Ok(_) => { | ||||
|             println!("Assuming build on windows"); | ||||
|             let output = Command::new("cmd") | ||||
|             .arg("/K") | ||||
|             .arg("npx") | ||||
|             .arg("webpack") | ||||
|             .current_dir("./src_webpack") | ||||
|             .output() | ||||
|         .expect("failed to execute process"); | ||||
|  | ||||
|             .unwrap(); | ||||
|             println!("status: {}", output.status); | ||||
|             println!("stdout: {}", String::from_utf8_lossy(&output.stdout)); | ||||
|             println!("stderr: {}", String::from_utf8_lossy(&output.stderr)); | ||||
|  | ||||
|             assert!(output.status.success()); | ||||
|         }, | ||||
|         Err(_) => { | ||||
|             println!("Assuming build on linux"); | ||||
|             let output = Command::new("bash") | ||||
|             .arg("webpack") | ||||
|             .current_dir("./src_webpack") | ||||
|             .output() | ||||
|             .unwrap(); | ||||
|             println!("status: {}", output.status); | ||||
|             println!("stdout: {}", String::from_utf8_lossy(&output.stdout)); | ||||
|             println!("stderr: {}", String::from_utf8_lossy(&output.stderr)); | ||||
|             assert!(output.status.success()); | ||||
|         },  | ||||
|  | ||||
|     } | ||||
|  | ||||
|  | ||||
|  | ||||
|     embuild::espidf::sysenv::output(); | ||||
|     let _ = EmitBuilder::builder().all_git().emit(); | ||||
|   | ||||
| @@ -1,3 +1,3 @@ | ||||
| [toolchain] | ||||
| channel = "nightly" | ||||
|  | ||||
| toolchain = "esp" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user