git://git.exim.org
/
exim-website.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed source for old versions of documentation
[exim-website.git]
/
script
/
gen.pl
diff --git
a/script/gen.pl
b/script/gen.pl
index d086fd38551e9f6e03d2c9a131e3777e655d2413..92cff58a7fb86c9b3220b73a2109c2825bde52b6 100755
(executable)
--- a/
script/gen.pl
+++ b/
script/gen.pl
@@
-1,9
+1,9
@@
-#!/usr/bin/perl
+#!/usr/bin/
env
perl
#
use strict;
use warnings;
#
use strict;
use warnings;
-use CSS::Minifier::XS;
+use CSS::Minifier::XS
0.07
;
use File::Copy;
use File::Find;
use File::Slurp;
use File::Copy;
use File::Find;
use File::Slurp;
@@
-26,7
+26,9
@@
do_web() if exists $opt{web};
## Add the exim-html-current symlink
print "Symlinking exim-html-current to exim-html-$opt{latest}\n";
## Add the exim-html-current symlink
print "Symlinking exim-html-current to exim-html-$opt{latest}\n";
-symlink( "$opt{docroot}/exim-html-$opt{latest}", "$opt{docroot}/exim-html-current" );
+unlink("$opt{docroot}/exim-html-current") if ( -l "$opt{docroot}/exim-html-current" );
+symlink( "exim-html-$opt{latest}", "$opt{docroot}/exim-html-current" )
+ || die "symlink to $opt{docroot}/exim-html-current failed";
## Generate the website files
sub do_web {
## Generate the website files
sub do_web {
@@
-313,7
+315,7
@@
sub transform {
mkdirp( ( $out_path =~ /^(.+)\/.+$/ )[0] );
## Write out the document
mkdirp( ( $out_path =~ /^(.+)\/.+$/ )[0] );
## Write out the document
- open my $out, '>', $out_path or die
$!
;
+ open my $out, '>', $out_path or die
"Unable to write $out_path - $!"
;
print $out $stylesheet->output_as_bytes($doc);
close $out;
}
print $out $stylesheet->output_as_bytes($doc);
close $out;
}
@@
-369,7
+371,7
@@
sub parse_arguments {
error_help('Excess arguments') if ( scalar(@ARGV) );
error_help('Must include at least one of --web, --spec or --filter')
error_help('Excess arguments') if ( scalar(@ARGV) );
error_help('Must include at least one of --web, --spec or --filter')
- unless (
defined $opt{web} || scalar( @{ $opt{spec} } ) || scalar( @{ $opt{web}
} ) );
+ unless (
$opt{web} || scalar( @{ $opt{spec} || [] } ) || scalar( @{ $opt{filter} || []
} ) );
return %opt;
}
return %opt;
}