mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-23 15:16:08 +00:00
35850967ef
* Provide a working rebar.cmd for system that need it (Windows on non-PowerShell) * Add tests for recent changes If the "run" were to fail the job would too * Check if Rust can find it
33 lines
670 B
Rust
33 lines
670 B
Rust
use std::env;
|
|
use std::process;
|
|
use std::string;
|
|
|
|
// an example function...
|
|
fn main() {
|
|
let key = "PATH";
|
|
match env::var(key) {
|
|
Ok(val) => println!("{key}: {val:?}"),
|
|
Err(e) => println!("couldn't interpret {key}: {e}"),
|
|
}
|
|
}
|
|
|
|
#[allow(dead_code)]
|
|
fn rebar3_cmd_version() -> Result<String, string::FromUtf8Error> {
|
|
println!("going for rebar3.cmd");
|
|
let output = process::Command::new("rebar3.cmd")
|
|
.arg("version")
|
|
.output()
|
|
.expect("error");
|
|
return String::from_utf8(output.stdout);
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
use super::*;
|
|
|
|
#[test]
|
|
fn it_works() {
|
|
rebar3_cmd_version().unwrap();
|
|
}
|
|
}
|