X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FApp%2FFatPacker.pm;h=90100e7f1ba9897368d91cff943822fd15ca6e50;hb=a4e040e954a647d292d4b74d10c25991481f2b9b;hp=b0dc9c9fee3a3703978ecfdce19bfc90dbd9f25d;hpb=f5a54fa1b2580a3c4c2edff38a5f57afef6454b9;p=p5sagit%2FApp-FatPacker.git diff --git a/lib/App/FatPacker.pm b/lib/App/FatPacker.pm index b0dc9c9..90100e7 100644 --- a/lib/App/FatPacker.pm +++ b/lib/App/FatPacker.pm @@ -13,7 +13,7 @@ use File::Copy qw(copy); use File::Path qw(make_path remove_tree); use B qw(perlstring); -our $VERSION = '0.009001'; # 0.9.1 +our $VERSION = '0.009005'; # 0.9.5 $VERSION = eval $VERSION; @@ -47,7 +47,7 @@ sub new { bless({}, $_[0]) } sub run_script { my ($self, $args) = @_; my @args = $args ? @$args : @ARGV; - (my $cmd = shift @args) =~ s/-/_/g; + (my $cmd = shift @args || 'help') =~ s/-/_/g; if (my $meth = $self->can("script_command_${cmd}")) { $self->$meth(\@args); } else { @@ -55,6 +55,10 @@ sub run_script { } } +sub script_command_help { + print "Try `perldoc fatpack` for how to use me\n"; +} + sub script_command_trace { my ($self, $args) = @_; @@ -167,7 +171,8 @@ sub script_command_file { unshift @INC, sub { if (my $fat = $fatpacked{$_[1]}) { - open my $fh, '<', \$fat; + open my $fh, '<', \$fat + or die "FatPacker error loading $_[1] (could be a perl installation issue?)"; return $fh; } return @@ -178,7 +183,7 @@ sub script_command_file { my @segments = map { (my $stub = $_) =~ s/\.pm$//; my $name = uc join '_', split '/', $stub; - my $data = $files{$_}; $data =~ s/^/ /mg; + my $data = $files{$_}; $data =~ s/^/ /mg; $data =~ s/(?packlists - $ fatpack tree fatlib `cat packlists` + $ fatpack packlists-for `cat fatpacker.trace` >packlists + $ fatpack tree `cat packlists` $ (fatpack file; cat myscript.pl) >myscript.packed.pl See the documentation for the L script itself for more information.