Update example [skip ci]

This commit is contained in:
Michiel Borkent 2020-11-28 15:43:30 +01:00
parent 5399f8b7cc
commit 1e0887673a

View file

@ -303,12 +303,11 @@ Using `bb` with a shebang also works:
``` clojure
#!/usr/bin/env bb
(require '[babashka.curl :as curl])
(defn get-url [url]
(println "Fetching url:" url)
(let [{:keys [:exit :err :out]} (shell/sh "curl" "-sS" url)]
(if (zero? exit) out
(do (println "ERROR:" err)
(System/exit 1)))))
(println "Downloading url:" url)
(curl/get url))
(defn write-html [file html]
(println "Writing file:" file)