@@ -22,10 +22,12 @@ (declare (uses margs)) (declare (uses configf)) ;; (declare (uses rmt)) (include "megatest-fossil-hash.scm") + +(require-library stml) (let ((debugcontrolf (conc (get-environment-variable "HOME") "/.mtutilrc"))) (if (file-exists? debugcontrolf) (load debugcontrolf))) @@ -584,10 +586,19 @@ (schema-file (conc install-home "/share/db/mt-pg.sql"))) (if (file-exists? schema-file) (system (conc "/bin/cat " schema-file))))) ((junk) (rmt:get-keys)))))))) + +;; If HTTP_HOST is defined then we must be in the cgi environment +;; so run stml and exit +;; +(if (get-environment-variable "HTTP_HOST") + (begin + (stml:main #f) + (exit))) + (if (or (args:get-arg "-repl") (args:get-arg "-load")) (begin (import extras) ;; might not be needed