From 1db32da3e531b9b07ec78eba10f63d4e95ce97a8 Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Sun, 28 Feb 2016 20:38:54 -0300 Subject: Fix ssg output containing additional / --- ssg | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ssg b/ssg index d77851b..f502040 100755 --- a/ssg +++ b/ssg @@ -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; -- cgit v1.2.3-70-g09d2