File tree Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,16 @@ fn main() {
2424 . expect ( "Copying precompiled erlang service escript failed" ) ;
2525 } else {
2626 let profile = env:: var ( "PROFILE" ) . unwrap ( ) ;
27- let output = Command :: new ( "rebar3" )
27+
28+ let mut cmd = if cfg ! ( target_os = "windows" ) {
29+ let mut cmd = Command :: new ( "cmd" ) ;
30+ cmd. args ( [ "/C" , "rebar3" ] ) ;
31+ cmd
32+ } else {
33+ Command :: new ( "rebar3" )
34+ } ;
35+
36+ let output = cmd
2837 . arg ( "escriptize" )
2938 . env ( "REBAR_PROFILE" , & profile)
3039 . env ( "REBAR_BASE_DIR" , & dest_dir)
Original file line number Diff line number Diff line change @@ -980,7 +980,15 @@ impl Project {
980980 rebar_setting. config_file
981981 ) ;
982982 let rebar_version = {
983- let mut cmd = Command :: new ( "rebar3" ) ;
983+
984+ let mut cmd = if cfg ! ( target_os = "windows" ) {
985+ let mut cmd = Command :: new ( "cmd" ) ;
986+ cmd. args ( [ "/C" , "rebar3" ] ) ;
987+ cmd
988+ } else {
989+ Command :: new ( "rebar3" )
990+ } ;
991+
984992 cmd. arg ( "version" ) ;
985993 utf8_stdout ( & mut cmd) ?
986994 } ;
Original file line number Diff line number Diff line change @@ -71,7 +71,15 @@ impl RebarConfig {
7171 static ref REBAR_GLOBAL_LOCK : Mutex <( ) > = Mutex :: new( ( ) ) ;
7272 }
7373 let guard = REBAR_GLOBAL_LOCK . lock ( ) ;
74- let mut cmd = Command :: new ( "rebar3" ) ;
74+
75+ let mut cmd = if cfg ! ( target_os = "windows" ) {
76+ let mut cmd = Command :: new ( "cmd" ) ;
77+ cmd. args ( [ "/C" , "rebar3" ] ) ;
78+ cmd
79+ } else {
80+ Command :: new ( "rebar3" )
81+ } ;
82+
7583 cmd. arg ( "as" ) ;
7684 cmd. arg ( & self . profile . 0 ) ;
7785 if let Some ( parent) = self . config_file . parent ( ) {
You can’t perform that action at this time.
0 commit comments