Skip to content

Instantly share code, notes, and snippets.

@mangosmoothie
Last active April 2, 2019 14:20
Show Gist options
  • Save mangosmoothie/d1be573acf95fb68810c10058436cf23 to your computer and use it in GitHub Desktop.
Save mangosmoothie/d1be573acf95fb68810c10058436cf23 to your computer and use it in GitHub Desktop.
clojure nested map destructuring
;;input [:app :env config-{}]
(defn download-archive
[app env
{:keys [build-number build-name workdir]
{:keys [base-url archive-api archive-type archive-input-regex user pass]} :artifactory
{{{:keys [regex]} app} env} :deploy}]
(write-stream {:in (io/input-stream
(get-archive-response-body
{:uname user
:pass pass
:uri (str base-url archive-api)
:build-number build-number
:build-name build-name
:archive-type archive-type
:regex (str regex archive-input-regex)}))
:location workdir
:name (str build-name "-" build-number "." (name archive-type))}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment