0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-06 14:50:20 -05:00

🐛 Fix problem with slashes in layers names for exporter

This commit is contained in:
alonso.torres 2023-07-07 12:45:10 +02:00
parent 735170debf
commit b565e20f1a
2 changed files with 6 additions and 4 deletions

View file

@ -52,6 +52,7 @@
- Fix picking a gradient color in recent colors for a new color in the assets tab [Taiga #5601](https://tree.taiga.io/project/penpot/issue/5601)
- Fix problem with importation process [Taiga #5597](https://tree.taiga.io/project/penpot/issue/5597)
- Fix problem with HSV color picker [#3317](https://github.com/penpot/penpot/issues/3317)
- Fix problem with slashes in layers names for exporter [#3276](https://github.com/penpot/penpot/issues/3276)
### :arrow_up: Deps updates

View file

@ -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)))))