diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-22 10:44:11 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-22 11:01:00 -0700 |
commit | be634f063cfdb2251bab512e79f9114ad7dc453c (patch) | |
tree | 7f44d1f391b39dc69e6625d0ca773603efb4a3a2 /src/data.lisp | |
parent | d78265215e967750fa6db21908a1464eacbc6d20 (diff) | |
download | consfigurator-be634f063cfdb2251bab512e79f9114ad7dc453c.tar.gz |
attempt to make remote Lisp show LOAD output only if loading fails
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/data.lisp')
-rw-r--r-- | src/data.lisp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/data.lisp b/src/data.lisp index ff21f1e..4cadde4 100644 --- a/src/data.lisp +++ b/src/data.lisp @@ -435,8 +435,20 @@ Preprocessing must occur in the root Lisp.")) ,@intern-forms (define-condition missing-data-source (error) ()) (require "asdf") - (let ((*standard-output* *error-output*)) - ,(wrap load-forms)) + ;; Hide the LOAD output unless loading failed, because + ;; there will be a lot of spurious warnings due to not + ;; compiling. + (let ((string (make-array '(0) + :element-type 'base-char + :fill-pointer 0 :adjustable t))) + (handler-case + (with-output-to-string (stream string) + (let ((*error-output* stream) + (*standard-output* stream)) + ,(wrap load-forms))) + (serious-condition (c) + (format *error-output* "~&Failed to LOAD:~%~A" c) + (uiop:quit 2)))) ,(wrap `((%consfigure ',remaining-connections ,*host*)))))) (handler-case (with-standard-io-syntax |