mirror of
https://github.com/penpot/penpot.git
synced 2025-07-15 11:25:12 +02:00
🐛 Fix problem with slashes in layers names for exporter
This commit is contained in:
parent
735170debf
commit
b565e20f1a
2 changed files with 6 additions and 4 deletions
|
@ -23,6 +23,9 @@
|
|||
(declare ^:private assoc-file-name)
|
||||
(declare prepare-exports)
|
||||
|
||||
;; Regex to clean namefiles
|
||||
(def sanitize-file-regex #"[\\/:*?\"<>|]")
|
||||
|
||||
(s/def ::file-id ::us/uuid)
|
||||
(s/def ::filename ::us/string)
|
||||
(s/def ::name ::us/string)
|
||||
|
@ -134,7 +137,7 @@
|
|||
:on-progress on-progress)
|
||||
|
||||
append (fn [{:keys [filename path] :as object}]
|
||||
(rsc/add-to-zip! zip path filename))
|
||||
(rsc/add-to-zip! zip path (str/replace filename sanitize-file-regex "_")))
|
||||
|
||||
proc (-> (p/do
|
||||
(p/loop [exports (seq exports)]
|
||||
|
@ -144,9 +147,7 @@
|
|||
(p/recur (rest exports)))))
|
||||
(.finalize zip))
|
||||
(p/then (constantly resource))
|
||||
(p/catch on-error))
|
||||
]
|
||||
|
||||
(p/catch on-error))]
|
||||
(if wait
|
||||
(p/then proc #(assoc exchange :response/body (dissoc % :path)))
|
||||
(assoc exchange :response/body (dissoc resource :path)))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue