Skip to content

Instantly share code, notes, and snippets.

@micha
Created November 23, 2014 22:22
Show Gist options
  • Select an option

  • Save micha/0a510590fc57527d1af8 to your computer and use it in GitHub Desktop.

Select an option

Save micha/0a510590fc57527d1af8 to your computer and use it in GitHub Desktop.
(require '[boot.core :as core]
'[boot.file :as file]
'[clojure.java.io :as io])
(let [tmpd (core/mktgtdir!)
srcs (->> (core/src-files+) (core/by-ext [".scss" ".sass"]))]
;; make hardlinks for all the scss and sass files into the tempdir
(doseq [in srcs]
(let [rel-path (core/relative-path in)
out (io/file tmpd rel-path)]
(file/copy-with-lastmod in out)))
;; given some file with path p in one of the user's source or resource dirs,
;; you can find the corresponding file that's been copied to the tempdir above
;; like this:
(let [file-user-refers-to (io/file p)
relative-path-of-file (core/relative-path file-user-refers-to)
corresponding-tempfile (io/file tmpd relative-path-of-file)]
;; here you can tell sassc to compile corresponding-tempfile
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment