| 18 | | '--para=i' => \$fork_num, |
| 19 | | '--dry-run' => \my $dry_run_fg, |
| 20 | | '--skip=s' => \my $skips, |
| 21 | | '--shell', => \my $shell, |
| 22 | | '--man' => \my $man, |
| 23 | | '--config=s' => \$config, |
| 24 | | ) |
| 25 | | or pod2usage(2); |
| 26 | | Getopt::Long::Configure("bundling"); # allows -p |
| 27 | | pod2usage(-verbose => 2) if $man; |
| 28 | | pod2usage(2) unless @ARGV; |
| | 20 | '--para=i' => \$fork_num, |
| | 21 | '--dry-run' => \my $dry_run_fg, |
| | 22 | '--skip=s' => \my $skips, |
| | 23 | '--shell', => \my $shell, |
| | 24 | '--man' => \my $man, |
| | 25 | '--config=s' => \$config, |
| | 26 | '--write-config' => \my $wc, |
| | 27 | ) or pod2usage( 2 ); |
| | 28 | Getopt::Long::Configure( "bundling" ); # allows -p |
| | 29 | pod2usage( -verbose => 2 ) if $man; |
| 30 | | for my $proj (@ARGV) { |
| | 31 | if ( !@ARGV ) { |
| | 32 | |
| | 33 | # name of the current dir, will be the project name |
| | 34 | my $dir = getcwd; |
| | 35 | my $f = File::Util->new; |
| | 36 | my $project = $f->strip_path( $dir ); |
| | 37 | $config = '.archer.yaml'; |
| | 38 | if ( $f->existent( $config ) ) { |
| | 39 | Archer->new( |
| | 40 | { project => $project, |
| | 41 | dry_run_fg => $dry_run_fg, |
| | 42 | parallel_num => $fork_num, |
| | 43 | skips => +{ map { $_ => 1 } split /,/, ( $skips || '' ) }, |
| | 44 | config_yaml => $config, |
| | 45 | argv_str => $argv_str, |
| | 46 | shell => $shell, |
| | 47 | } |
| | 48 | )->run; |
| | 49 | exit; |
| | 50 | } |
| | 51 | else { |
| | 52 | Archer->new( |
| | 53 | { project => $project, |
| | 54 | dry_run_fg => $dry_run_fg, |
| | 55 | config_yaml => $config, |
| | 56 | write_config => $wc, |
| | 57 | } |
| | 58 | )->run; |
| | 59 | exit; |
| | 60 | } |
| | 61 | pod2usage( 2 ) unless @ARGV; |
| | 62 | } |
| | 63 | |
| | 64 | for my $proj ( @ARGV ) { |
| 32 | | { |
| 33 | | project => $proj, |
| 34 | | dry_run_fg => $dry_run_fg, |
| 35 | | parallel_num => $fork_num, |
| 36 | | skips => +{ map { $_ => 1 } split /,/, ($skips || '')}, |
| 37 | | config_yaml => $config, |
| 38 | | argv_str => $argv_str, |
| 39 | | shell => $shell, |
| | 66 | { project => $proj, |
| | 67 | dry_run_fg => $dry_run_fg, |
| | 68 | parallel_num => $fork_num, |
| | 69 | skips => +{ map { $_ => 1 } split /,/, ( $skips || '' ) }, |
| | 70 | config_yaml => $config, |
| | 71 | argv_str => $argv_str, |
| | 72 | shell => $shell, |
| | 73 | write_config => $wc, |