X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tools%2Fmkdescriptions;h=141be7c53d605c6a662726cbb5704a6d9582c42b;hb=b378b5087b41f72a1624ebb58990180e0b0140aa;hp=ee29f48e9c346d075afb5ca7f667294997654b2a;hpb=751112d9a980c98591ddd097e6bcf146edb42be3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/tools/mkdescriptions b/tools/mkdescriptions index ee29f48e9..141be7c53 100755 --- a/tools/mkdescriptions +++ b/tools/mkdescriptions @@ -2,7 +2,7 @@ # # InspIRCd -- Internet Relay Chat Daemon # -# Copyright (C) 2020 Sadie Powell +# Copyright (C) 2020-2021 Sadie Powell # # This file is part of InspIRCd. InspIRCd is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public @@ -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,8 +34,8 @@ use lib dirname $RealDir; use make::common; use make::console; -if (scalar @ARGV < 1) { - print_format "<|GREEN Usage:|> $0 <<|UNDERLINE DOCS-SITE|>>\n", *STDERR; +unless (scalar @ARGV) { + say STDERR console_format "<|GREEN Usage:|> $0 <<|UNDERLINE DOCS-SITE|>>"; 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;