From fe6a0d1db2635fbb13f861f0bfcb485ae5476912 Mon Sep 17 00:00:00 2001 From: Colin Jones Date: Tue, 19 Mar 2013 23:12:08 -0500 Subject: [PATCH 1/2] Unify & expand the profile list for show-profiles --- leiningen-core/src/leiningen/core/project.clj | 2 +- src/leiningen/show_profiles.clj | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/leiningen-core/src/leiningen/core/project.clj b/leiningen-core/src/leiningen/core/project.clj index c16c6dc7..faeeba48 100755 --- a/leiningen-core/src/leiningen/core/project.clj +++ b/leiningen-core/src/leiningen/core/project.clj @@ -411,7 +411,7 @@ (warn-user-profile profiles) profiles)) -(defn- read-profiles +(defn read-profiles "Read profiles from a variety of sources. We check Leiningen's defaults, system-level profiles (usually in diff --git a/src/leiningen/show_profiles.clj b/src/leiningen/show_profiles.clj index e0c33b49..e284261b 100644 --- a/src/leiningen/show_profiles.clj +++ b/src/leiningen/show_profiles.clj @@ -1,13 +1,10 @@ (ns leiningen.show-profiles (:require [clojure.string] [clojure.pprint :as pprint] - [leiningen.core.project :as project] - [leiningen.core.user :as user])) + [leiningen.core.project :as project])) (defn- all-profiles [project] - (merge @project/default-profiles - (user/profiles) - (:profiles project))) + (project/read-profiles project)) (defn ^:no-project-needed show-profiles "List all available profiles or display one if given an argument." From 3a2cf943243a6bba44294fca741a9e55429127e9 Mon Sep 17 00:00:00 2001 From: Colin Jones Date: Tue, 19 Mar 2013 23:13:30 -0500 Subject: [PATCH 2/2] Grant non-project profile access to with-profile --- src/leiningen/with_profile.clj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/leiningen/with_profile.clj b/src/leiningen/with_profile.clj index 21a8b2da..3e2aae3d 100644 --- a/src/leiningen/with_profile.clj +++ b/src/leiningen/with_profile.clj @@ -8,7 +8,9 @@ "Apply the given task with a comma-separated profile list." [project profiles task-name args] (hooke/with-scope - (let [project (and project (project/set-profiles project profiles)) + (let [project (and project (project/set-profiles + (project/project-with-profiles project) + profiles)) task-name (main/lookup-alias task-name project)] (main/apply-task task-name project args))))