boot-clj/boot

Dynamic var to customize env at task creation time

Open

#468 建立於 2016年6月2日

在 GitHub 查看
 (8 留言) (0 反應) (0 負責人)Clojure (178 fork)batch import
help wanted

倉庫指標

Star
 (1,748 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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

貢獻者指南