Identifying headers added to generated files.
This commit is contained in:
parent
0800756288
commit
05623f0168
|
@ -4,6 +4,8 @@
|
|||
(:require [clojure.java.io :refer [file]]
|
||||
[clojure.math.combinatorics :refer [combinations]]
|
||||
[clojure.string :as s]
|
||||
[clj-time.core :as t]
|
||||
[clj-time.format :as f]
|
||||
[squirrel-parse.to-adl :refer [migrations-to-xml]]
|
||||
[squirrel-parse.utils :refer [is-link-table? singularise]]))
|
||||
|
||||
|
@ -281,13 +283,20 @@
|
|||
[adl-struct (migrations-to-xml migrations-path "Ignored")
|
||||
file-content (apply
|
||||
str
|
||||
(doall (map
|
||||
(cons
|
||||
(str "-- "
|
||||
output
|
||||
" autogenerated by \n-- [squirrel-parse](https://github.com/simon-brooke/squirrel-parse)\n-- at "
|
||||
(f/unparse (f/formatters :basic-date-time) (t/now))
|
||||
"\n\n")
|
||||
(doall
|
||||
(map
|
||||
#(:query %)
|
||||
(vals
|
||||
(apply
|
||||
merge
|
||||
(map
|
||||
#(queries % adl-struct)
|
||||
(vals adl-struct)))))))]
|
||||
(vals adl-struct))))))))]
|
||||
(spit output file-content)
|
||||
file-content)))
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
[clojure.math.combinatorics :refer [combinations]]
|
||||
[clojure.pprint :refer [pprint write]]
|
||||
[clojure.string :as s]
|
||||
[clj-time.core :as t]
|
||||
[clj-time.format :as f]
|
||||
[squirrel-parse.to-adl :refer [migrations-to-xml]]
|
||||
[squirrel-parse.to-hugsql-queries :refer [queries]]
|
||||
[squirrel-parse.utils :refer [is-link-table? singularise]]))
|
||||
|
@ -40,8 +42,10 @@
|
|||
(defn file-header [parent-name this-name]
|
||||
(list
|
||||
'ns
|
||||
^{:doc "JSON routes auto-generated by squirrel-parse"}
|
||||
(symbol (str parent-name "." this-name))
|
||||
(str "JSON routes for " parent-name
|
||||
" auto-generated by [squirrel-parse](https://github.com/simon-brooke/squirrel-parse) at "
|
||||
(f/unparse (f/formatters :basic-date-time) (t/now)))
|
||||
(list
|
||||
'require
|
||||
'[noir.response :as nresponse]
|
||||
|
|
Loading…
Reference in a new issue