File tree 1 file changed +1
-41
lines changed
1 file changed +1
-41
lines changed Original file line number Diff line number Diff line change 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} ;
8
2
9
3
use e2e:: exec_builder:: ExecBuilder ;
10
4
use tempfile:: tempdir;
@@ -16,40 +10,6 @@ use tempfile::tempdir;
16
10
17
11
const SNM_CMD : & str = "snm" ;
18
12
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
-
53
13
#[ test]
54
14
fn should_auto_install ( ) -> Result < ( ) , Box < dyn Error > > {
55
15
let node_version = "16.0.0" ;
You can’t perform that action at this time.
0 commit comments