Give upload a main

This commit is contained in:
Nathan McCarty 2024-12-20 08:08:55 +00:00
parent 4e5b4cc2fc
commit b1ee31c58f

View file

@ -4,21 +4,8 @@ use paths;
use File::Temp;
use DOM::Tiny;
# Find and collect all of our idris files
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
my $build-path = "build/ttc/".IO.dir[0];
# Get a temporary directory to work in
my $dir = tempdir().IO;
my $build-path;
my $dir;
my constant $background-css = '
body {
@ -63,14 +50,31 @@ sub render-idris-file($idr) {
$out-file.spurt: $contents;
}
# 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;
# TODO : Build index
sub MAIN() {
# Find and collect all of our idris files
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;
# 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";