@@ -3,7 +3,7 @@ use v5.10.1;
3
3
use strict;
4
4
use warnings;
5
5
use Cwd;
6
- use IPC::Cmd qw< run> ;
6
+ use IPC::Cmd qw< run can_run > ;
7
7
use NQP::Config qw< cmp_rev slurp system_or_die run_or_die> ;
8
8
9
9
use base qw< NQP::Config> ;
@@ -23,8 +23,19 @@ sub configure_backends {
23
23
$self -> use_backend($be );
24
24
}
25
25
}
26
- if ( defined $options -> {' gen-moar' } || !$self -> active_backends ) {
27
- $self -> use_backend(' moar' );
26
+ else {
27
+ my $have_gen_moar = defined $options -> {' gen-moar' };
28
+ if ( $have_gen_moar || can_run(' moar' ) ) {
29
+ say " ===WARNING!===\n " ,
30
+ " No backends specified on the command line.\n " ,
31
+ " Using 'moar' because we found it in the PATH."
32
+ unless $have_gen_moar ;
33
+ $self -> use_backend(' moar' );
34
+ }
35
+ else {
36
+ $self -> sorry( " No backends specified on the command line.\n "
37
+ . " Please use --backends or --gen-moar" );
38
+ }
28
39
}
29
40
if ( $self -> active_backend(' js' ) and !$self -> active_backend(' moar' ) ) {
30
41
$self -> sorry(
@@ -99,8 +110,9 @@ sub configure_js_backend {
99
110
100
111
$self -> backend_config(
101
112
' js' ,
102
- js_build_dir => $self -> nfp( " $config ->{base_dir}/gen/js" , no_quote => 1 ),
103
- js_blib => " node_modules" ,
113
+ js_build_dir =>
114
+ $self -> nfp( " $config ->{base_dir}/gen/js" , no_quote => 1 ),
115
+ js_blib => " node_modules" ,
104
116
);
105
117
}
106
118
0 commit comments