Skip to content

Commit

Permalink
ignore dotfiles and backup files in the watch list
Browse files Browse the repository at this point in the history
  • Loading branch information
s1037989 committed Oct 2, 2016
1 parent 2b18ddd commit ed078b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,5 +1,8 @@
Revision history for perl distribution App-prowess

0.04 Not Released
- Ignore dotfiles and backup files in the watch list

0.03 2015-11-27T11:04:54+0100
- Fix http://cpantesters.org/cpan/report/3259e778-8ee4-11e5-b888-bf4ee0bfc7aa

Expand Down
10 changes: 6 additions & 4 deletions script/prowess
Expand Up @@ -40,16 +40,18 @@ sub run {
my $self = shift;
my $args = $self->parse_argv(@_);
my $watcher = Filesys::Notify::Simple->new($args->{watch});
my $ignore = qr{(?:/\.[^/]+$|\.bak$|\.old$|\.swp$|~$)};
my @changed = (1);
my $exit = 0;

while (1) {
my $pid = $self->run_prove($args->{prove});
my $pid = @changed ? $self->run_prove($args->{prove}) : 0;
eval {
# Try to capture:
# kevent error: Interrupt innerhalb eines Systemaufrufs at /usr/perl5.20.0/lib/site_perl/5.20.0/Filesys/Notify/KQueue.pm line 114.
# Try to capture:
# kevent error: Interrupt innerhalb eines Systemaufrufs at /usr/perl5.20.0/lib/site_perl/5.20.0/Filesys/Notify/KQueue.pm line 114.
$watcher->wait(
sub {
return unless my @changed = grep { !-d $_ } map { $_->{path} } @_;
return unless @changed = grep { !-d $_ && $_ !~ $ignore } map { $_->{path} } @_;
warn "[prowess] changed: @changed\n" if DEBUG;
my $kill = kill TERM => $pid;
warn "[prowess] kill TERM $pid\n" if DEBUG and $kill;
Expand Down

0 comments on commit ed078b3

Please sign in to comment.