Last minute but: was failing to read the SYSOUT file from the jar.

This commit is contained in:
Simon Brooke 2023-04-10 14:41:50 +01:00
parent 8c5727f5df
commit 362b19ae25
No known key found for this signature in database
GPG key ID: A7A4F18D1D4DF987

View file

@ -46,7 +46,7 @@
;;; ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(def ^:constant default-sysout "resources/lisp1.5.lsp") (def ^:constant default-sysout "lisp1.5.lsp")
(defn- full-path (defn- full-path
[fp] [fp]
@ -154,18 +154,18 @@
**NOTE THAT** this is an extension function, not available in strct mode." **NOTE THAT** this is an extension function, not available in strct mode."
([] ([]
(SYSIN (or (:read *options*) default-sysout))) (SYSIN (or (:read *options*) (str "resources/" default-sysout))))
([filename] ([filename]
(let [fp (file (full-path (str filename))) (let [fp (file (full-path (str filename)))
file (when (and (.exists fp) (.canRead fp)) fp) file (when (and (.exists fp) (.canRead fp)) fp)
res (try (resource filename) res (try (resource filename)
(catch Throwable _ nil)) (catch Throwable _ nil))
content (try (READ (slurp (or file res))) content (try (READ (slurp (or file res)))
(catch Throwable any (catch Throwable _
(throw (ex-info "Ne can ārǣde" (throw (ex-info "Ne can ārǣde"
{:context "SYSIN" {:context "SYSIN"
:filepath fp} :filename filename
any))))] :filepath fp}))))]
(swap! oblist (swap! oblist
#(when (or % (seq content)) #(when (or % (seq content))
(resolve-subroutines content)))))) (resolve-subroutines content))))))