Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (33 sloc) 0.779 kB
unit module BreakDancer;
use Shell::Command;
our $basedir = 'www';
our $ext = '.html';
multi gen($path, &code) is export {
mkpath "$basedir/$path";
given open("$basedir/$path/index$ext", :w) {
.say: &code();
.close;
}
}
multi gen($path, @args, &code) is export {
mkpath "$basedir/$path";
for @args -> $a {
my $p = "$basedir/$path/$a";
mkpath $p;
given open("$p/index$ext", :w) {
.say: &code($a);
.close;
}
}
}
multi gen($path, %args, &code) is export {
mkpath "$basedir/$path";
for %args.kv -> $k, $v {
my $p = "$basedir/$path/$k";
mkpath $p;
given open("$p/index$ext", :w) {
.say: &code($k, $v);
.close;
}
}
}
Jump to Line
Something went wrong with that request. Please try again.