Browse files

filter to be installed files

Do not install .files and only install .bat files on windows.
  • Loading branch information...
1 parent 68bbdff commit 38664d724d44fba2f76e307c8fc5df481e073ac3 @FROGGS FROGGS committed Mar 1, 2014
Showing with 14 additions and 4 deletions.
  1. +14 −4 lib/Panda/Installer.pm
View
18 lib/Panda/Installer.pm
@@ -36,11 +36,21 @@ method install($from, $to? is copy, Panda::Project :$bone) {
}
indir $from, {
# check if $.destdir is under control of a CompUnitRepo
- my @files;
- for <blib bin> {
- @files := (@files, find(dir => $_, type => 'file').list).flat if .IO.d
- }
if $to.can('install') {
+ my @files;
+ if 'blib'.IO ~~ :d {
+ @files.push: find(dir => 'blib', type => 'file').list.grep( -> $lib {
+ next if $lib.basename.substr(0, 1) eq '.';
+ $lib
+ } )
+ }
+ if 'bin'.IO ~~ :d {
+ @files.push: find(dir => 'bin', type => 'file').list.grep( -> $bin {
+ next if $bin.basename.substr(0, 1) eq '.';
+ next if $*OS ne 'MSWin32' and $bin.basename ~~ /\.bat$/;
+ $bin
+ } )
+ }
$to.install(:dist($bone), @files);
}
else {

0 comments on commit 38664d7

Please sign in to comment.