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
:opt-un [::ignore-warnings]))
:opt-un [::ignore-warnings
(s/def ::events (s/coll-of ::event))
......@@ -41,6 +41,14 @@
(last args))
(defn file-exists? [path]
(.isFile (.statSync fs path))
(catch :default e
;; TODO: output an error message here?
(defn slurp [path]
{:pre [(string? path)]}
......@@ -169,6 +177,7 @@
[spec x]
(if-not (s/valid? spec x)
(println (write-yaml x))
(s/explain spec x)
(process.exit 1))
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