Update example [skip ci]
This commit is contained in:
parent
5399f8b7cc
commit
1e0887673a
1 changed files with 4 additions and 5 deletions
|
|
@ -303,12 +303,11 @@ Using `bb` with a shebang also works:
|
||||||
``` clojure
|
``` clojure
|
||||||
#!/usr/bin/env bb
|
#!/usr/bin/env bb
|
||||||
|
|
||||||
|
(require '[babashka.curl :as curl])
|
||||||
|
|
||||||
(defn get-url [url]
|
(defn get-url [url]
|
||||||
(println "Fetching url:" url)
|
(println "Downloading url:" url)
|
||||||
(let [{:keys [:exit :err :out]} (shell/sh "curl" "-sS" url)]
|
(curl/get url))
|
||||||
(if (zero? exit) out
|
|
||||||
(do (println "ERROR:" err)
|
|
||||||
(System/exit 1)))))
|
|
||||||
|
|
||||||
(defn write-html [file html]
|
(defn write-html [file html]
|
||||||
(println "Writing file:" file)
|
(println "Writing file:" file)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue