boot-clj/boot

Dynamic var to customize env at task creation time

Open

#468 geöffnet am 2. Juni 2016

Auf GitHub ansehen
 (8 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Clojure (178 Forks)batch import
help wanted

Repository-Metriken

Stars
 (1.748 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

It would be nice to shadow the global env to better separate multiple apps running in the same boot pipeline. This shadowing is only needed at task creation time, not run time.

As discussed in Slack a dynamic var *env* (in boot.pod or boot.core) might be the solution.

;; binding *env* when creating the pipeline
(binding [*env* (get-env)]
  (my-task))
(deftask my-task []
  (fn [next-task]
    ;; bind env outside fileset-receiving fn
    (let [env *env*]
      (fn [fileset]
        (pod/make-pod env ,,,))))

/cc @micha @arichiardi

Contributor Guide