Skip to content

Commit

Permalink
Fix: Error when no file detected recursively
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Gautier committed Aug 29, 2017
1 parent 680c0cc commit ed912c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions betty-doc.pl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
# -- Dan Luedtke <[email protected]>

my $V = '1.0';
my $P = $0;

sub printVersion {

Expand Down Expand Up @@ -3151,6 +3152,11 @@ ($)
my @files_to_process = @ARGV;
if ($recursive == 1) {
@files_to_process = split(/\n/, `find . -name "*.c" -o -name "*.h"`);
if (scalar @files_to_process == 0) {
my $exec_name = basename($P);
print "$exec_name: no input files\n";
exit(1);
}
}

foreach (@files_to_process) {
Expand Down
5 changes: 5 additions & 0 deletions betty-style.pl
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,11 @@ sub git_commit_info {
my @files_to_process = @ARGV;
if ($recursive == 1) {
@files_to_process = split(/\n/, `find . -name "*.c" -o -name "*.h"`);
if (scalar @files_to_process == 0) {
my $exec_name = basename($P);
print "$exec_name: no input files\n";
exit(1);
}
}

my $vname;
Expand Down

0 comments on commit ed912c7

Please sign in to comment.