Skip to content

Commit

Permalink
Ignore emacs files in manifests using recursive directories
Browse files Browse the repository at this point in the history
  • Loading branch information
pbiggar committed May 10, 2012
1 parent fc74e78 commit 22efef3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dieter-core/src/dieter/asset/manifest.clj
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ We should probably consider outputting some kind of warning in that case."
(find-file filename (.getParentFile manifest-file)))))
flatten
(filter #(and (not (nil? %))
(not (.isDirectory %))))
(not (.isDirectory %))
(not (re-matches #"/.*\.#.*$" (.getCanonicalPath %)))))
(distinct-by #(.getCanonicalPath %))))

(defrecord Dieter [file]
Expand Down
6 changes: 6 additions & 0 deletions dieter-core/test/dieter/test/asset/manifest.clj
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@

(testing "multiple requires are included only once, the first occurrence"
(is (has-text? text "var file = \"/lib/framework.js\"" 1)))))


(deftest test-emacs-file
(let [manifest (io/file "test/fixtures/assets/javascripts/emacs_test/emacs.js.dieter")
files (manifest-files manifest)]
(is (not (contains-file? files (io/file "test/fixtures/assets/javascripts/emacs_test/nested/.#testfile.coffee"))))))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["nested"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This file should not be included, because it is the sort of file emacs leaves
lying around, which will causes dieter to syntax-error during compilation.

0 comments on commit 22efef3

Please sign in to comment.