]> granicus.if.org Git - fortune-mod/commitdiff
refactor: remove unused imports
authorShlomi Fish <shlomif@shlomifish.org>
Sat, 15 Aug 2020 13:36:57 +0000 (16:36 +0300)
committerShlomi Fish <shlomif@shlomifish.org>
Wed, 16 Sep 2020 11:00:36 +0000 (14:00 +0300)
fortune-mod/fortune/gen-strfile-manpage.pl

index f9fc6691fab9c7ca5dea3b35947b29e466932287..432e8f8c179e437907ee6a399b275b859b49df9d 100644 (file)
@@ -4,9 +4,8 @@ use strict;
 use warnings;
 use autodie;
 
-use File::Basename qw / dirname /;
-use File::Path qw / mkpath /;
 use Getopt::Long qw/ GetOptions /;
+use Path::Tiny qw/ path tempdir tempfile cwd /;
 
 my $output_fn;
 my $cookiedir;
@@ -21,13 +20,12 @@ GetOptions(
     '--output=s'           => \$output_fn,
 ) or die "Wrong options - $!";
 
+die "missing --src-dir" if ( not $CMAKE_CURRENT_SOURCE_DIR );
 system( qw# docmake manpages #,
     "${CMAKE_CURRENT_SOURCE_DIR}/util/strfile.docbook5.xml" )
     and die "system failed";
 
-use Path::Tiny qw/ path tempdir tempfile cwd /;
-
 path("${CMAKE_CURRENT_SOURCE_DIR}/util/strfile.man")
     ->spew_utf8(
-    path("./strfile.1")->slurp_utf8() =~ s#^\s+(\.RE|\.PP)\s*$#$1#gmsr =~
+    cwd()->child("strfile.1")->slurp_utf8() =~ s#^\s+(\.RE|\.PP)\s*$#$1#gmsr =~
         s#^\s+$##gmsr );