From 8c70709927c4de08c5d9c389e4a7806334d59734 Mon Sep 17 00:00:00 2001 From: Wes Morgan Date: Tue, 6 Sep 2022 13:22:38 -0600 Subject: [PATCH] Allow env vars OS_NAME & OS_ARCH to override os props This is helpful when caching pods in an artifact for deployment to another OS/arch than the one we're building on. --- src/babashka/pods/impl/resolver.clj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/babashka/pods/impl/resolver.clj b/src/babashka/pods/impl/resolver.clj index 8432b43..690ef48 100644 --- a/src/babashka/pods/impl/resolver.clj +++ b/src/babashka/pods/impl/resolver.clj @@ -15,8 +15,9 @@ "x86_64" arch)) -(def os {:os/name (System/getProperty "os.name") - :os/arch (let [arch (System/getProperty "os.arch")] +(def os {:os/name (or (System/getenv "OS_NAME") (System/getProperty "os.name")) + :os/arch (let [arch (or (System/getenv "OS_ARCH") + (System/getProperty "os.arch"))] (normalize-arch arch))}) (defn warn [& strs]