mirror of
https://github.com/penpot/penpot.git
synced 2025-05-30 10:56:10 +02:00
🐛 Fix unexpected exception bug on exporter.
Puppetter bug, fixed upgrading it.
This commit is contained in:
parent
7cf120e2e1
commit
e94e202cef
2 changed files with 31 additions and 23 deletions
|
@ -7,6 +7,7 @@
|
|||
(ns app.config
|
||||
(:refer-clojure :exclude [get])
|
||||
(:require
|
||||
[app.common.data :as d]
|
||||
["process" :as process]
|
||||
[cljs.pprint]
|
||||
[cuerdas.core :as str]
|
||||
|
@ -35,20 +36,27 @@
|
|||
[prefix]
|
||||
(let [env (unchecked-get process "env")
|
||||
kwd (fn [s] (-> (str/kebab s) (str/keyword)))
|
||||
prefix (str prefix "-")
|
||||
prefix (str prefix "_")
|
||||
len (count prefix)]
|
||||
(reduce (fn [res key]
|
||||
(cond-> res
|
||||
(str/starts-with? key prefix)
|
||||
(assoc (kwd (subs key len))
|
||||
(unchecked-get env key))))
|
||||
(let [val (unchecked-get env key)
|
||||
key (str/lower key)]
|
||||
(cond-> res
|
||||
(str/starts-with? key prefix)
|
||||
(assoc (kwd (subs key len)) val))))
|
||||
{}
|
||||
(js/Object.keys env))))
|
||||
|
||||
(defn- prepare-config
|
||||
[]
|
||||
(let [env (read-env "penpot")
|
||||
env (d/without-nils env)
|
||||
data (merge defaults env)]
|
||||
(us/conform ::config data)))
|
||||
|
||||
(def config
|
||||
(atom (->> (read-env "penpot")
|
||||
(merge defaults)
|
||||
(us/conform ::config))))
|
||||
(atom (prepare-config)))
|
||||
|
||||
|
||||
(defn get
|
||||
"A configuration getter."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue