Skip to content

Commit

Permalink
Add unmerge-profiles function.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsantiago committed May 9, 2012
1 parent 6bbf4fc commit 155d32a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions leiningen-core/src/leiningen/core/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,16 @@
[:profiles] merge
profiles-map)}))

(defn unmerge-profiles
"Given a project map, return the project map you would have if the specified
profiles had never been merged into it. Expects a list of profiles, where
each element is either the name of a profile in the :profiles key of the
project, or the map of the profile itself."
[project profiles-to-unmerge]
(let [result-profiles (filter (comp not (into #{} profiles-to-unmerge))
(:included-profiles project))]
(merge-profiles (:without-profiles project project) result-profiles)))

(defn read
"Read project map out of file, which defaults to project.clj."
([file profiles]
Expand Down

0 comments on commit 155d32a

Please sign in to comment.