Commit 0a32d3f3 authored by phil's avatar phil

add license and check files for existence

parent 0377668b
This diff is collapsed.
......@@ -31,9 +31,11 @@
:iso-string (s/and string? match-iso-date)))
(s/def ::property string?)
(s/def ::ignore-warnings (s/coll-of ::property))
(s/def ::file util/file-exists?)
(s/def ::event (s/keys :req-un [::type
::date]
:opt-un [::ignore-warnings]))
:opt-un [::ignore-warnings
::file]))
(s/def ::events (s/coll-of ::event))
......
......@@ -41,6 +41,14 @@
(last args))
(defn file-exists? [path]
(try
(.isFile (.statSync fs path))
(catch :default e
;; TODO: output an error message here?
false)))
(defn slurp [path]
{:pre [(string? path)]}
(try
......@@ -169,6 +177,7 @@
[spec x]
(if-not (s/valid? spec x)
(do
(println (write-yaml x))
(s/explain spec x)
(process.exit 1))
x))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment