Skip to content

Commit

Permalink
WHOOPS! Introduced bugs when I was supposed just to be documenting.
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-brooke committed Feb 19, 2020
1 parent b2ee34b commit a775ef7
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
74 changes: 37 additions & 37 deletions src/smeagol/configuration.clj
Original file line number Diff line number Diff line change
Expand Up @@ -106,46 +106,46 @@
{:from :smeagol-site-title :to :site-title}))


(defn- build-config
(def build-config
"The actual configuration, as a map. The idea here is that the config
file is read (if it is specified and present), but that individual
values can be overridden by environment variables."
[]
(try
(log/info (str "Reading configuration from " config-file-path))
(let [file-contents (try
(read-string (slurp config-file-path))
(catch Exception x
(log/error
(str
"Failed to read configuration from "
config-file-path
" because: "
(type x)
"; "
(.getMessage x)))
{}))
config (merge
file-contents
(transform-map
(from-env-vars
:smeagol-content-dir
:smeagol-default-locale
:smeagol-formatters
:smeagol-js-from
:smeagol-log-level
:smeagol-passwd
:smeagol-site-title)
config-env-transforms))]
(if (env :dev)
(log/debug
"Loaded configuration\n"
(with-out-str (clojure.pprint/pprint config))))
config)
(catch Exception any
(log/error any "Could not load configuration")
{})))
(memoize (fn []
(try
(log/info (str "Reading configuration from " config-file-path))
(let [file-contents (try
(read-string (slurp config-file-path))
(catch Exception x
(log/error
(str
"Failed to read configuration from "
config-file-path
" because: "
(type x)
"; "
(.getMessage x)))
{}))
config (merge
file-contents
(transform-map
(from-env-vars
:smeagol-content-dir
:smeagol-default-locale
:smeagol-formatters
:smeagol-js-from
:smeagol-log-level
:smeagol-passwd
:smeagol-site-title)
config-env-transforms))]
(if (env :dev)
(log/debug
"Loaded configuration\n"
(with-out-str (clojure.pprint/pprint config))))
config)
(catch Exception any
(log/error any "Could not load configuration")
{})))))

(def config
"The actual configuration, as a map."
(memoize build-config))
(build-config))
2 changes: 1 addition & 1 deletion src/smeagol/formatting.clj
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
(declare process-text)


(defn- process-backticks
(defn process-backticks
"Effectively, escape the backticks surrounding this `text`, by protecting them
from the `process-text` filter.
Expand Down

0 comments on commit a775ef7

Please sign in to comment.