From 32a8c6bd4383b7d0c877615163f4550412e7cdb2 Mon Sep 17 00:00:00 2001 From: Nathan McCarty Date: Mon, 27 Jan 2025 04:45:38 -0500 Subject: [PATCH] Add upload option to build-book script --- scripts/build-book | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/build-book b/scripts/build-book index 4b56c42..5572774 100755 --- a/scripts/build-book +++ b/scripts/build-book @@ -63,6 +63,7 @@ sub katla($src, $ttc-src) { $output ~~ s:g/'class="IdrisData"'/class="hljs-title"/; $output ~~ s:g/'class="IdrisType"'/class="hljs-type"/; $output ~~ s:g/'class="IdrisNamespace"'/class="hljs-symbol hljs-emphasis"/; + # Spurt the output to the temporary directory my $output-path = $tempdir.add: $src; if !$output-path.parent.d { @@ -92,3 +93,9 @@ indir $tempdir, { # Copy it over rm_rf "book"; 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; +}