incise.utils

delete-recursively

(delete-recursively root)

Delete a directory tree.

directory?

(directory? afile)

getenv

(getenv variable & [default])

A nice wrapper around System/getenv that allows a second argument to be passed in as the default.

log-file

(log-file color prefix a-file)

normalize-uri

(normalize-uri uri)

Prepend index.html to a uri with a trailing slash.

remove-prefix-from-path

(remove-prefix-from-path prefix-file afile)

Remove the given prefix from the given path.

slot-by

(slot-by keys-fn coll)

Take a function which when called on each item in the given collection returns a sequence of keys to value to.

temp-dir

(temp-dir prefix)(temp-dir prefix suffix)(temp-dir prefix suffix tries)

Create a temporary directory. Returns nil if dir could not be created even after n tries (default 10).

wrap-log-exceptions

(wrap-log-exceptions func & {:keys [bubble], :or {bubble true}})