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 @@ -979,7 +979,15 @@ impl Project {
979979 rebar_setting. config_file
980980 ) ;
981981 let rebar_version = {
982- let mut cmd = Command :: new ( "rebar3" ) ;
982+
983+ let mut cmd = if cfg ! ( target_os = "windows" ) {
984+ let mut cmd = Command :: new ( "cmd" ) ;
985+ cmd. args ( [ "/C" , "rebar3" ] ) ;
986+ cmd
987+ } else {
988+ Command :: new ( "rebar3" )
989+ } ;
990+
983991 cmd. arg ( "version" ) ;
984992 utf8_stdout ( & mut cmd) ?
985993 } ;
Original file line number Diff line number Diff line change @@ -73,7 +73,15 @@ impl RebarConfig {
7373 static ref REBAR_GLOBAL_LOCK : Mutex <( ) > = Mutex :: new( ( ) ) ;
7474 }
7575 let guard = REBAR_GLOBAL_LOCK . lock ( ) ;
76- let mut cmd = Command :: new ( "rebar3" ) ;
76+
77+ let mut cmd = if cfg ! ( target_os = "windows" ) {
78+ let mut cmd = Command :: new ( "cmd" ) ;
79+ cmd. args ( [ "/C" , "rebar3" ] ) ;
80+ cmd
81+ } else {
82+ Command :: new ( "rebar3" )
83+ } ;
84+
7785 cmd. arg ( "as" ) ;
7886 cmd. arg ( & self . profile . 0 ) ;
7987 if let Some ( parent) = self . config_file . parent ( ) {
You can’t perform that action at this time.
0 commit comments