Skip to content

Commit

Permalink
Added bake.core/context?, a utility function that returns true when i…
Browse files Browse the repository at this point in the history
…ts argument names the current context.
  • Loading branch information
davidsantiago authored and ninjudd committed Jan 5, 2011
1 parent 9d9c176 commit 0f1c93b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bake/bake/core.clj
Expand Up @@ -61,3 +61,8 @@
`(try (set-context! ~context)
(do ~@forms)
(set-project! *project-root*)))

(defn context? [ctx-name]
"Returns true iff the argument is the currently selected context. Argument can
be anything that clojure.core/name turns into a string."
(= (name (:context *project*)) (name ctx-name)))

0 comments on commit 0f1c93b

Please sign in to comment.