mirror of
https://github.com/penpot/penpot.git
synced 2025-08-01 06:18:31 +02:00
🐛 Add support for multiple formats on clone-template
This commit is contained in:
parent
68bd8152b8
commit
efd4a11ae2
11 changed files with 140 additions and 119 deletions
|
@ -16,10 +16,13 @@
|
|||
[app.util.time :as dt]
|
||||
[app.worker :as wrk]
|
||||
[datoteka.fs :as fs]
|
||||
[datoteka.io :as io]
|
||||
[integrant.core :as ig]
|
||||
[promesa.exec :as px]
|
||||
[promesa.exec.csp :as sp])
|
||||
(:import
|
||||
java.io.InputStream
|
||||
java.io.OutputStream
|
||||
java.nio.file.Files))
|
||||
|
||||
(def default-tmp-dir "/tmp/penpot")
|
||||
|
@ -86,3 +89,12 @@
|
|||
(fs/delete-on-exit! path)
|
||||
(sp/offer! queue [path (some-> min-age dt/duration)])
|
||||
path))
|
||||
|
||||
(defn tempfile-from
|
||||
"Create a new tempfile from from consuming the stream"
|
||||
[input & {:as options}]
|
||||
(let [path (tempfile options)]
|
||||
(with-open [^InputStream input (io/input-stream input)]
|
||||
(with-open [^OutputStream output (io/output-stream path)]
|
||||
(io/copy input output)))
|
||||
path))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue