Add upload option to build-book script

This commit is contained in:
Nathan McCarty 2025-01-27 04:45:38 -05:00
parent 4683cd72b9
commit 32a8c6bd43

View file

@ -63,6 +63,7 @@ sub katla($src, $ttc-src) {
$output ~~ s:g/'class="IdrisData"'/class="hljs-title"/; $output ~~ s:g/'class="IdrisData"'/class="hljs-title"/;
$output ~~ s:g/'class="IdrisType"'/class="hljs-type"/; $output ~~ s:g/'class="IdrisType"'/class="hljs-type"/;
$output ~~ s:g/'class="IdrisNamespace"'/class="hljs-symbol hljs-emphasis"/; $output ~~ s:g/'class="IdrisNamespace"'/class="hljs-symbol hljs-emphasis"/;
# Spurt the output to the temporary directory # Spurt the output to the temporary directory
my $output-path = $tempdir.add: $src; my $output-path = $tempdir.add: $src;
if !$output-path.parent.d { if !$output-path.parent.d {
@ -92,3 +93,9 @@ indir $tempdir, {
# Copy it over # Copy it over
rm_rf "book"; rm_rf "book";
cp $tempdir.add("book"), "book", :r; cp $tempdir.add("book"), "book", :r;
if $upload {
my $rsync = run 'rsync', '-avzh', $tempdir.add("book").Str,
'ubuntu@static.stranger.systems:/var/www/static.stranger.systems/idris-by-contrived-example';
die "rsync went bad" unless $rsync;
}