[skip ci] Update portal example
This commit is contained in:
parent
b95e826179
commit
06123c78a8
1 changed files with 8 additions and 9 deletions
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue