Edn file manipulation
Edn file manipulation
(create-tmp-edn)
Create a temporary file directory string with edn extension
Create a temporary file directory string with edn extension
(is-clojure-like-file filename)
Returns true if the file's extension is clojure like
Returns true if the file's extension is clojure like
(read-edn edn-filename)
(read-edn edn-filename loader-fn)
Read the .edn
file,
Params:
edn-filename
name of the edn file to loadloader-fn
(Optional, default: files/read-file) a function returning the content of the fileErrors:
file
could be a string representing the name of the file to load
or a (io/resource) object representing the name of the file to loadRead the `.edn` file, Params: * `edn-filename` name of the edn file to load * `loader-fn` (Optional, default: files/read-file) a function returning the content of the file Errors: * throws an exception if the file is not found * throws an exception if the file is a valid edn * `file` could be a string representing the name of the file to load or a (io/resource) object representing the name of the file to load
(spit-edn deps-edn-filename content)
(spit-edn edn-filename content header)
Spit the content
in the edn file called deps-edn-filename
.
If any, the header is added at the top of the file
Params:
edn-filename
Filenamecontent
What is spittedheader
the header that is added to the content, followed by the timestamp - is automatically preceded with ;;
Return the content of the fileSpit the `content` in the edn file called `deps-edn-filename`. If any, the header is added at the top of the file Params: * `edn-filename` Filename * `content` What is spitted * `header` the header that is added to the content, followed by the timestamp - is automatically preceded with ;; Return the content of the file
(update-edn-content edn-filename update-fn)
(update-edn-content edn-filename update-fn header)
Update the edn file content with the params-to-merge
map
Returns the content of the file
Params:
edn-filename
the name of the file to updateupdate-fn
function updating the content (fn [edn-content] (assoc edn-content ...))header
optional is a string added at the top of the file
Note: the content will be formatted thanks to automaton.core.adapters.code-formatter
Update the edn file content with the `params-to-merge` map Returns the content of the file Params: * `edn-filename` the name of the file to update * `update-fn` function updating the content (fn [edn-content] (assoc edn-content ...)) * `header` optional is a string added at the top of the file Note: the content will be formatted thanks to `automaton.core.adapters.code-formatter`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close