[skip ci] Update portal example

This commit is contained in:
Michiel Borkent 2021-01-27 13:07:09 +01:00
parent b95e826179
commit 06123c78a8

View file

@ -1,16 +1,20 @@
#!/usr/bin/env bb #!/usr/bin/env bb
(ns portal (ns portal
(:require [babashka.classpath :as cp] (:require [babashka.deps :as deps]
[cheshire.core :as json] [cheshire.core :as json]
[clj-yaml.core :as yaml] [clj-yaml.core :as yaml]
[clojure.data.xml :as xml] [clojure.data.xml :as xml]
[clojure.edn :as edn] [clojure.edn :as edn]
[clojure.java.shell :refer [sh]]
[clojure.string :as str])) [clojure.string :as str]))
(def cp (str/trim (:out (sh "clojure" "-Spath" "-Sdeps" "{:deps {djblue/portal {:mvn/version \"0.6.1\"}}}")))) (deps/add-deps '{:deps {djblue/portal {:mvn/version "0.9.0"}}})
(cp/add-classpath cp)
(require '[portal.api :as p])
(.addShutdownHook (Runtime/getRuntime)
(Thread. (fn [] (p/close))))
(def file (first *command-line-args*)) (def file (first *command-line-args*))
(when-not file (when-not file
@ -42,11 +46,6 @@
:namespace-aware false) :namespace-aware false)
(xml->hiccup)))) (xml->hiccup))))
(require '[portal.api :as p])
(.addShutdownHook (Runtime/getRuntime)
(Thread. (fn [] (p/close))))
(p/open) (p/open)
(p/tap) (p/tap)