We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b6e876 commit b5cf125Copy full SHA for b5cf125
src/main/clojure/tools/project.clj
@@ -12,7 +12,9 @@
12
[tools.process :as process])
13
(:import
14
(java.io
15
- File)))
+ File)
16
+ (java.net
17
+ URL)))
18
19
20
(defmacro safe
@@ -45,10 +47,19 @@
45
47
default (dissoc clauses :default)))
46
48
49
-(defn read-edn
- [^File file]
50
- (when (and file (.exists file))
51
- (aero/read-config file)))
+(defprotocol IReader
+ (read-edn [this]))
52
+
53
54
+(extend-protocol IReader
55
+ File
56
+ (read-edn [^File file]
57
+ (when (.exists file)
58
+ (aero/read-config file)))
59
60
+ URL
61
+ (read-edn [^URL url]
62
+ (aero/read-config url)))
63
64
65
(def project-filename "project.edn")
@@ -61,7 +72,6 @@
72
[]
73
(some->> "io/lazy-cat/tools/project/config.edn"
74
(io/resource)
- (io/file)
75
(read-edn)))
66
76
67
77
0 commit comments