1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#[cfg(test)]
#[path = "./shell_to_batch_test.rs"]
mod shell_to_batch_test;
use command;
use shell2batch;
pub fn execute(script: &Vec<String>) {
if cfg!(windows) {
let shell_script = script.join("\n");
let windows_batch = shell2batch::convert(&shell_script);
let windows_script_lines = windows_batch.split("\n").map(|string| string.to_string()).collect();
command::run_script(&windows_script_lines, None, true);
} else {
command::run_script(script, None, true);
};
}