Skip to content

Commit 08a0663

Browse files
committed
Editor: Fix broken transpiler save-data queries
1 parent 8e522f5 commit 08a0663

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

editor/src/clj/editor/code/transpilers.clj

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
[editor.fs :as fs]
2626
[editor.graph-util :as gu]
2727
[editor.resource :as resource]
28+
[editor.resource-node :as resource-node]
2829
[editor.ui :as ui]
2930
[editor.workspace :as workspace]
3031
[internal.java :as java]
@@ -56,14 +57,14 @@
5657

5758
(defn- make-temporary-compile-directory! [transpiler all-source-save-datas]
5859
(let [dir (fs/create-temp-directory! (str "tr-" (.getSimpleName (class transpiler))))]
59-
(run! (fn [{:keys [resource content dirty?]}]
60+
(run! (fn [{:keys [resource dirty] :as save-data}]
6061
(let [file (io/file dir (resource/path resource))]
6162
(io/make-parents file)
62-
(if content
63-
(spit file content)
63+
(if-some [modified-content (resource-node/save-data-content save-data)]
64+
(spit file modified-content)
6465
(with-open [is (io/input-stream resource)]
6566
(io/copy is file)))
66-
(when-not dirty?
67+
(when-not dirty
6768
(.setLastModified file (.lastModified (io/file resource))))))
6869
all-source-save-datas)
6970
dir))
@@ -74,8 +75,8 @@
7475
all-sources (conj source-code-save-datas build-file-save-data)
7576
workspace (resource/workspace (:resource build-file-save-data))
7677
proj-path->node-id (pair-map-by (comp resource/proj-path :resource) :node-id all-sources)
77-
use-project-dir (every? (fn [{:keys [resource dirty?]}]
78-
(and (not dirty?) (resource/file-resource? resource)))
78+
use-project-dir (every? (fn [{:keys [resource dirty]}]
79+
(and (not dirty) (resource/file-resource? resource)))
7980
all-sources)
8081
;; We transpile to lua from the project dir only if all the source code files exist on disc. Since
8182
;; some source file may come as dependencies in zip archives or modified in memory without saving

0 commit comments

Comments
 (0)