From f6b861f12d070ba931d829505bfd3229653f5df2 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 25 Jan 2021 12:13:54 +0000 Subject: Fix unnecessary begin blocks in Perl source files. --- tools/mkdescriptions | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'tools/mkdescriptions') diff --git a/tools/mkdescriptions b/tools/mkdescriptions index ee29f48e9..bb6f011d8 100755 --- a/tools/mkdescriptions +++ b/tools/mkdescriptions @@ -18,15 +18,7 @@ # -BEGIN { - require 5.10.0; - unless (-f 'configure') { - print "Error: $0 must be run from the main source directory!\n"; - exit 1; - } -} - -use feature ':5.10'; +use v5.10.0; use strict; use warnings FATAL => qw(all); @@ -42,7 +34,7 @@ use lib dirname $RealDir; use make::common; use make::console; -if (scalar @ARGV < 1) { +unless (scalar @ARGV) { print_format "<|GREEN Usage:|> $0 <<|UNDERLINE DOCS-SITE|>>\n", *STDERR; exit 1; } @@ -51,7 +43,8 @@ my %version = get_version(); my $docdir = rel2abs catdir $ARGV[0], 'docs', $version{MAJOR}, 'modules'; print_error "unable to find the module directory at $docdir!" unless -d $docdir; -for my $module (, , ) { +my $root = dirname $RealDir; +for my $module (<$root/src/modules/extra/m_*.cpp>, <$root/src/modules/m_*.cpp>, <$root/src/modules/m_*/main.cpp>) { print_error "unable to extract module name from $module!" unless $module =~ /m_(\w+)[.\/]/; my $docfile = catfile $docdir, "$1.md"; print_error "unable to find the module documentation at $docfile!" unless -f $docfile; -- cgit v1.2.3