File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -24,17 +24,24 @@ use selenium_manager::shell;
24
24
use selenium_manager:: shell:: run_shell_command_by_os;
25
25
use std:: borrow:: BorrowMut ;
26
26
use std:: env:: consts:: OS ;
27
- use std:: path:: Path ;
27
+ use std:: path:: { Path , PathBuf } ;
28
28
29
29
#[ allow( dead_code) ]
30
30
pub fn get_selenium_manager ( ) -> Command {
31
- let path = env ! ( "CARGO_BIN_EXE_selenium-manager" ) ;
31
+ let mut path = PathBuf :: from ( env ! ( "CARGO_BIN_EXE_selenium-manager" ) ) ;
32
32
33
- if Path :: new ( path) . exists ( ) {
33
+ if path. exists ( ) {
34
34
return Command :: new ( path) ;
35
35
}
36
36
37
- panic ! ( "Binary not found {}" , path)
37
+ if cfg ! ( windows) {
38
+ let exe_path = path. with_extension ( "exe" ) ;
39
+ if exe_path. exists ( ) {
40
+ return Command :: new ( exe_path) ;
41
+ }
42
+ }
43
+
44
+ panic ! ( "Binary not found {}" , path_to_string( & path) ) ;
38
45
}
39
46
40
47
#[ allow( dead_code) ]
You can’t perform that action at this time.
0 commit comments