Skip to content

Commit 6bfff00

Browse files
committed
remove exec
1 parent d3bfd55 commit 6bfff00

File tree

1 file changed

+1
-41
lines changed

1 file changed

+1
-41
lines changed

e2e/tests/snm_install_test.rs

+1-41
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
use std::{
2-
env::current_dir,
3-
error::Error,
4-
fs,
5-
path::PathBuf,
6-
process::{Command, Output},
7-
};
1+
use std::{env::current_dir, error::Error, fs};
82

93
use e2e::exec_builder::ExecBuilder;
104
use tempfile::tempdir;
@@ -16,40 +10,6 @@ use tempfile::tempdir;
1610

1711
const SNM_CMD: &str = "snm";
1812

19-
fn exec(
20-
shell: &str,
21-
current: &PathBuf,
22-
envs: &Vec<(&str, String)>,
23-
) -> Result<String, Box<dyn Error>> {
24-
let shell_vec = shell
25-
.split(" ")
26-
.map(|item| item.trim())
27-
.collect::<Vec<&str>>();
28-
29-
if let Some((bin_name, args)) = shell_vec.split_first() {
30-
let output = Command::new(bin_name)
31-
.envs(envs.clone())
32-
.args(args)
33-
.current_dir(current)
34-
.output()?;
35-
36-
let stdout = String::from_utf8_lossy(&output.stdout).to_string();
37-
let stderr = String::from_utf8_lossy(&output.stderr).to_string();
38-
39-
println!(
40-
r##"
41-
Exec shell: {}
42-
Stdout: {}
43-
Stderr: {}
44-
"##,
45-
shell, stdout, stderr
46-
);
47-
Ok(stdout)
48-
} else {
49-
Err("Invalid shell command".into())
50-
}
51-
}
52-
5313
#[test]
5414
fn should_auto_install() -> Result<(), Box<dyn Error>> {
5515
let node_version = "16.0.0";

0 commit comments

Comments
 (0)