diff --git a/book/update.cgi b/book/update.cgi index a6b078d4..baea8731 100755 --- a/book/update.cgi +++ b/book/update.cgi @@ -1,32 +1,57 @@ -#!/usr/bin/perl - -use strict; -use warnings; - -use CGI; -my $r = new CGI; - -print $r->header(); -print "
pulling repo...
";
-system 'git fetch origin && git reset --hard origin/master';
-system 'git submodule update --init --recursive';
-print "
done.
building documentation...
";
-chdir "..";
-
-my $status = system('/bin/bash', '-c', '
- source venv/bin/activate &&
- poetry install --only docs &&
- sphinx-build -M html underactuated /tmp/underactuated_doc &&
- rm -rf book/python &&
- cp -r /tmp/underactuated_doc/html book/python
-');
-
-if ($status == 0) {
- print "
done.
pulling repo...
") + print(f"{git_output}") + print("
done.
") + print("building documentation...
") + print(f"{build_output}") + print("
done.
") + print("") + +except Exception as e: + print("Content-Type: text/html\n") + print("") + print(f"Error: {str(e)}
") + print("")