diff options
author | Matias Linares <matiaslina@openmailbox.org> | 2016-02-28 20:38:54 -0300 |
---|---|---|
committer | Matias Linares <matiaslina@openmailbox.org> | 2016-02-28 20:38:54 -0300 |
commit | 1db32da3e531b9b07ec78eba10f63d4e95ce97a8 (patch) | |
tree | 59b0427a535b6a5aaba94b06b91ac51f1a20184c | |
parent | d95c1f51aa137bb832451be426c0db6c7f79bf00 (diff) | |
download | ssg-1db32da3e531b9b07ec78eba10f63d4e95ce97a8.tar.gz |
Fix ssg output containing additional /
-rwxr-xr-x | ssg | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -161,7 +161,7 @@ sub run_on { # 3) die if the output file is in the input directory. next if $outfile eq $mddir; next if $outfile =~ m/(\.|\.\.)($|\/)/; - $outfile =~ s/^$indir/$outdir/g; + $outfile =~ s/^$indir/$outdir\//g; $outfile !~ m/^$indir/ or die "trying to write in the same directory $outfile"; if($file->is_dir()) { @@ -172,7 +172,8 @@ sub run_on { } $outfile =~ s/md$/html/g; - print STDERR "* writing: $outfile\n"; + # This file it's just for pretty print + print STDERR "* writing: " . file($outfile) . "\n"; my $contents = generate_page $file; open FD, ">$outfile" or die " [ERROR] cannot open > $outfile: $!";; @@ -186,7 +187,7 @@ sub run_on { my %opts = ( 'v' => 0, 'h' => 0, - 'o' => "site.static" + 'o' => "site.static/" ); getopts('vho:', \%opts); $indir = shift @ARGV; |