Skip to content

Commit

Permalink
Backport fix for crossover problem from 0.1.0.
Browse files Browse the repository at this point in the history
Fixes #38.
  • Loading branch information
emezeske committed Feb 21, 2012
1 parent adc04ba commit ef269ff
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions support/src/cljsbuild/core.clj
Expand Up @@ -142,10 +142,14 @@
(fs/mkdirs dir))
(dofor [[[_ from-resource] to-file] (zipmap from-resources to-files)]
(when (crossover-needs-update? from-resource to-file)
(spit to-file (filtered-crossover-file from-resource))
; Mark the file as read-only, to hopefully warn the user not to modify it.
(fs/chmod "-w" to-file)
:updated))))
(let [temp-file (str to-file ".tmp")]
; Write a temp file and atomically rename to the real file
; to prevent the compiler from reading a half-written file
(spit temp-file (filtered-crossover-file from-resource))
(fs/rename temp-file to-file)
; Mark the file as read-only, to hopefully warn the user not to modify it.
(fs/chmod "-w" to-file)
:updated)))))

(defn in-threads
"Given a seq and a function, applies the function to each item in a different thread
Expand Down

0 comments on commit ef269ff

Please sign in to comment.