Skip to content

Commit

Permalink
Merge pull request #112 from tony-o/♻-ignored-dirs
Browse files Browse the repository at this point in the history
🙈 as well as ♻️ to DRY, add .github
  • Loading branch information
tony-o authored Jan 26, 2024
2 parents f8b1965 + 2614d81 commit 5134c73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
.precomp
sdist/
tmp/

# Comma
.idea/
7 changes: 5 additions & 2 deletions lib/Fez/Bundle.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ for @chandlers -> $h {
die 'Unable to find a suitable handler for bundling (tried pax, and tar), please ensure one is in your path'
unless @handlers.elems;

constant @ignored-dirs = '.git/*', 'sdist/*', '.github/*';

sub bundle($target, :$dry-run = False) is export {
my $sdist = $target.IO.absolute.IO.add('sdist');
mkdir $sdist.absolute unless $sdist.d;
Expand All @@ -34,8 +36,9 @@ sub bundle($target, :$dry-run = False) is export {
my $location = $sdist.add($io);

my $ignorer = '.'.IO.add('.gitignore').IO.f
?? parse(|'.'.IO.add('.gitignore').IO.slurp.lines, '.git/*', 'sdist/*', :git-ignore)
!! parse('.git/*', '.precomp', 'sdist/*');
?? parse(|'.'.IO.add('.gitignore').IO.slurp.lines, | @ignored-dirs,
:git-ignore)
!! parse( '.precomp', |@ignored-dirs);

my @manifest = ls('.'.IO, -> $fn {
$ignorer.rmatch($fn.Str)
Expand Down

0 comments on commit 5134c73

Please sign in to comment.