File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 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;
2424use selenium_manager:: shell:: run_shell_command_by_os;
2525use std:: borrow:: BorrowMut ;
2626use std:: env:: consts:: OS ;
27- use std:: path:: Path ;
27+ use std:: path:: { Path , PathBuf } ;
2828
2929#[ allow( dead_code) ]
3030pub 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" ) ) ;
3232
33- if Path :: new ( path) . exists ( ) {
33+ if path. exists ( ) {
3434 return Command :: new ( path) ;
3535 }
3636
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) ) ;
3845}
3946
4047#[ allow( dead_code) ]
You can’t perform that action at this time.
0 commit comments