aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@openmailbox.org>2016-02-28 20:38:54 -0300
committerMatias Linares <matiaslina@openmailbox.org>2016-02-28 20:38:54 -0300
commit1db32da3e531b9b07ec78eba10f63d4e95ce97a8 (patch)
tree59b0427a535b6a5aaba94b06b91ac51f1a20184c
parentd95c1f51aa137bb832451be426c0db6c7f79bf00 (diff)
downloadssg-1db32da3e531b9b07ec78eba10f63d4e95ce97a8.tar.gz
Fix ssg output containing additional /
-rwxr-xr-xssg7
1 files 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;