Skip to content

Commit

Permalink
fixes #14: used templates are configurable
Browse files Browse the repository at this point in the history
via the project level gargamel config edn
  • Loading branch information
Benedek Fazekas committed Jan 7, 2015
1 parent 251131b commit cc976ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Binary file modified bin/gargamel.jar
Binary file not shown.
10 changes: 9 additions & 1 deletion src/leiningen/gargamel.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
[gargamel.git :as git]
[stencil.core :as st]
[clojure.java.io :as io]
[clojure.edn :as edn])
[clojure.edn :as edn]
[stencil.loader :as stl])
(:import java.io.File))

(def ^:dynamic proj-name nil)
Expand Down Expand Up @@ -104,6 +105,13 @@
(binding [proj-name project-name
target-path path]
(let [proj-dir (or project-dir ".")]
(when-let [template-dir (-> project-config :template-dir io/file)]
(when (.exists template-dir)
(doseq [template-file (->> (file-seq template-dir)
(filter #(and (.isFile %) (.endsWith (.getName %) ".mustache")))
(map #(.getCanonicalFile %)))]

(stl/register-template (str/replace (.getName template-file) #"(.*)\..*" "$1") (slurp template-file)))))
(println (format "Generating changelog for project %s between %s and %s" project-name from to))
(create-html-changelog (enrich-changelog (changelog from to {:name project-name :dir proj-dir}) proj-dir)
from to proj-dir))))
Expand Down

0 comments on commit cc976ca

Please sign in to comment.