File tree 2 files changed +48
-1
lines changed
2 files changed +48
-1
lines changed Original file line number Diff line number Diff line change @@ -37,5 +37,6 @@ WriteMakefile(
37
37
' YAML::Tiny' => ' 1.74' ,
38
38
' URL::Encode' => ' 0.03' ,
39
39
},
40
- text => { TESTS => ' t/*.t t/*/*.t it/*.t it/*/*.t' }
40
+ EXE_FILES => [' bin/slick' ],
41
+ test => { TESTS => ' t/*.t t/*/*.t it/*.t it/*/*.t' }
41
42
);
Original file line number Diff line number Diff line change
1
+ # !/usr/bin/env perl
2
+
3
+ use 5.036;
4
+ use utf8;
5
+
6
+ use File::Basename;
7
+ use Cwd qw( getcwd) ;
8
+ use Scalar::Util qw( reftype) ;
9
+ use DDP;
10
+
11
+ my $valid_verbs = [qw( run generate module) ];
12
+ my $verb = shift ;
13
+ my $lib_dir = getcwd . ' /lib' ;
14
+
15
+ (
16
+ say
17
+ " Invalid command '$verb ' type 'slick help' for a list of the valid commands."
18
+ && exit 1 )
19
+ unless grep { $_ eq $verb } $valid_verbs -> @*;
20
+
21
+ my $noun = shift ;
22
+
23
+ unless ($noun ) {
24
+ say qq{ No noun provided, please provide a noun for the command: '$verb '} ;
25
+
26
+ if ( $verb eq ' run' ) {
27
+ say qq{ Perhaps you meant something like: 'slick run app.pl'?} ;
28
+ }
29
+ elsif ( $verb eq ' generate' ) {
30
+ say
31
+ qq{ Perhaps you meant something like: 'slick generate router MyApp::Router::ItemRouter'} ;
32
+ }
33
+
34
+ exit 1;
35
+ }
36
+
37
+ if ( $verb eq ' run' ) {
38
+ do ( rindex ( $noun , ' /' , 0 ) == 0 ? $noun : ' ./' . $noun );
39
+ wait && exit 0;
40
+ }
41
+
42
+ unless ( -d $lib_dir ) {
43
+ say qq{ Could not find directory: $lib_dir } ;
44
+ say ' Please create this directory to continue.' ;
45
+ exit 1;
46
+ }
You can’t perform that action at this time.
0 commit comments