-
I want to dynamically generate value for Thnx The build hook code: (ns script.build
(:require
[clojure.string :refer [trim]]
[clojure.java.shell :as shell]))
(defn setup
"Gitpod generate URL for open port so we should
use this URL to properly forward connection from browser to the server"
{:shadow.build/stage :configure}
[build-state]
(if (not-empty (System/getenv "GITPOD_WORKSPACE_URL"))
(assoc-in build-state [:devtools :devtools-url]
(trim (:out (shell/sh "gp" "url" "9630"))))
build-state)) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
At the shadow-cljs/src/main/shadow/build/targets/shared.clj Lines 219 to 220 in c28859a So in your build hook you can |
Beta Was this translation helpful? Give feedback.
At the
:configure
stage the:devtools-url
will already be applied to the place it is actually used. So updating the place where it came from will do nothing. Basically all this sets is this:closure-defines
key/val pair.shadow-cljs/src/main/shadow/build/targets/shared.clj
Lines 219 to 220 in c28859a
So in your build hook you can
(assoc-in build-state [:compiler-options :closure-defines 'shadow.cljs.devtools.client.env/devtools-url] new-url)
.