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
|
||||
#!/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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue