Give upload a main
This commit is contained in:
parent
4e5b4cc2fc
commit
b1ee31c58f
|
@ -4,21 +4,8 @@ use paths;
|
||||||
use File::Temp;
|
use File::Temp;
|
||||||
use DOM::Tiny;
|
use DOM::Tiny;
|
||||||
|
|
||||||
# Find and collect all of our idris files
|
my $build-path;
|
||||||
my @idris-files =
|
my $dir;
|
||||||
paths("src", :file(-> $a {$a.ends-with(".idr") || $a.ends-with(".md")}))
|
|
||||||
.map: *.IO.relative("src/".IO);
|
|
||||||
|
|
||||||
|
|
||||||
# Do a pack clean build so we can find the ttms
|
|
||||||
exit -1 unless run <pack clean>;
|
|
||||||
exit -1 unless run <pack build>;
|
|
||||||
|
|
||||||
# find our ttc folder
|
|
||||||
my $build-path = "build/ttc/".IO.dir[0];
|
|
||||||
|
|
||||||
# Get a temporary directory to work in
|
|
||||||
my $dir = tempdir().IO;
|
|
||||||
|
|
||||||
my constant $background-css = '
|
my constant $background-css = '
|
||||||
body {
|
body {
|
||||||
|
@ -63,14 +50,31 @@ sub render-idris-file($idr) {
|
||||||
$out-file.spurt: $contents;
|
$out-file.spurt: $contents;
|
||||||
}
|
}
|
||||||
|
|
||||||
# For each of our idris files, find the ttm, and generate the output in the
|
sub MAIN() {
|
||||||
# temporary directory
|
# Find and collect all of our idris files
|
||||||
for @idris-files.hyper -> $idr {
|
my @idris-files =
|
||||||
|
paths("src", :file(-> $a {$a.ends-with(".idr") || $a.ends-with(".md")}))
|
||||||
|
.map: *.IO.relative("src/".IO);
|
||||||
|
|
||||||
|
|
||||||
|
# Do a pack clean build so we can find the ttms
|
||||||
|
exit -1 unless run <pack clean>;
|
||||||
|
exit -1 unless run <pack build>;
|
||||||
|
|
||||||
|
# find our ttc folder
|
||||||
|
$build-path = "build/ttc/".IO.dir[0];
|
||||||
|
|
||||||
|
# Get a temporary directory to work in
|
||||||
|
$dir = tempdir().IO;
|
||||||
|
|
||||||
|
# For each of our idris files, find the ttm, and generate the output in the
|
||||||
|
# temporary directory
|
||||||
|
for @idris-files.hyper -> $idr {
|
||||||
render-idris-file $idr;
|
render-idris-file $idr;
|
||||||
# TODO : Build index
|
# TODO : Build index
|
||||||
|
}
|
||||||
|
|
||||||
|
# Upload files
|
||||||
|
run <rsync -rvh>, "$dir/",
|
||||||
|
"ubuntu@129.153.226.221:/var/www/static.stranger.systems/AoC/2024";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Upload files
|
|
||||||
run <rsync -rvh>, "$dir/",
|
|
||||||
"ubuntu@129.153.226.221:/var/www/static.stranger.systems/AoC/2024";
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue