Fix download-only? fn & use new env var names (#1357)

This commit is contained in:
Wes Morgan 2022-09-07 13:08:53 -06:00 committed by GitHub
parent ef84df8bc9
commit a592104bc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -745,8 +745,21 @@ Use bb run --help to show this help output.
(defn download-only? (defn download-only?
"If we're preparing pods for another OS / arch, don't try to run them." "If we're preparing pods for another OS / arch, don't try to run them."
[] []
(or (not= (System/getenv "OS_NAME") (System/getProperty "os.name")) (let [env-os-name (System/getenv "BABASHKA_PODS_OS_NAME")
(not= (System/getenv "OS_ARCH") (System/getProperty "os.arch")))) env-os-name-present? (not (str/blank? env-os-name))
sys-os-name (System/getProperty "os.name")
env-os-arch (System/getenv "BABASHKA_PODS_OS_ARCH")
env-os-arch-present? (not (str/blank? env-os-arch))
sys-os-arch (System/getProperty "os.arch")]
(when @common/debug
(binding [*out* *err*]
(println "System OS name:" sys-os-name)
(when env-os-name-present? (println "BABASHKA_PODS_OS_NAME:" env-os-name))
(println "System OS arch:" sys-os-arch)
(when env-os-arch-present? (println "BABASHKA_PODS_OS_ARCH:" env-os-arch))))
(cond
env-os-name-present? (not= env-os-name sys-os-name)
env-os-arch-present? (not= env-os-arch sys-os-arch))))
(defn exec [cli-opts] (defn exec [cli-opts]
(binding [*unrestricted* true] (binding [*unrestricted* true]