From a1a36bf22949183aeeef03a300eb104e0427f0d3 Mon Sep 17 00:00:00 2001 From: Kjetil Thuen Date: Tue, 10 Oct 2023 15:57:44 +0200 Subject: [PATCH 1/2] Use $GITLIB env-var when set --- bbin | 7 +++++-- src/babashka/bbin/scripts/common.clj | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bbin b/bbin index a2c39dd..7531de9 100755 --- a/bbin +++ b/bbin @@ -543,10 +543,13 @@ WARNING: (We won't make any changes without asking you first.) (defn local-lib-path [script-deps] (let [lib (key (first script-deps)) - coords (val (first script-deps))] + coords (val (first script-deps)) + gitlibs-root (if-let [override (not-empty (System/getenv "GITLIBS"))] + override + "~/.gitlibs")] (if (#{::no-lib} lib) (:local/root coords) - (fs/expand-home (str/join fs/file-separator ["~" ".gitlibs" "libs" (namespace lib) (name lib) (:git/sha coords)]))))) + (fs/expand-home (str/join fs/file-separator [gitlibs-root "libs" (namespace lib) (name lib) (:git/sha coords)]))))) (defn- load-bin-config [script-root] (require 'babashka.bbin.specs) diff --git a/src/babashka/bbin/scripts/common.clj b/src/babashka/bbin/scripts/common.clj index 94f4d8e..b258e07 100644 --- a/src/babashka/bbin/scripts/common.clj +++ b/src/babashka/bbin/scripts/common.clj @@ -87,10 +87,13 @@ (defn local-lib-path [script-deps] (let [lib (key (first script-deps)) - coords (val (first script-deps))] + coords (val (first script-deps)) + gitlibs-root (if-let [override (not-empty (System/getenv "GITLIBS"))] + override + "~/.gitlibs")] (if (#{::no-lib} lib) (:local/root coords) - (fs/expand-home (str/join fs/file-separator ["~" ".gitlibs" "libs" (namespace lib) (name lib) (:git/sha coords)]))))) + (fs/expand-home (str/join fs/file-separator [gitlibs-root "libs" (namespace lib) (name lib) (:git/sha coords)]))))) (defn- load-bin-config [script-root] (require 'babashka.bbin.specs) From 830fccc8efa98dd784e482b1a0f16255beda44a1 Mon Sep 17 00:00:00 2001 From: Kjetil Thuen Date: Tue, 10 Oct 2023 16:21:45 +0200 Subject: [PATCH 2/2] Use Windows friendly path when GITLIBS is not set Use Windows friendly path when GITLIBS is not set --- bbin | 2 +- src/babashka/bbin/scripts/common.clj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bbin b/bbin index 7531de9..2ae46e3 100755 --- a/bbin +++ b/bbin @@ -546,7 +546,7 @@ WARNING: (We won't make any changes without asking you first.) coords (val (first script-deps)) gitlibs-root (if-let [override (not-empty (System/getenv "GITLIBS"))] override - "~/.gitlibs")] + (str/join fs/file-separator [(fs/home) ".gitlibs"]))] (if (#{::no-lib} lib) (:local/root coords) (fs/expand-home (str/join fs/file-separator [gitlibs-root "libs" (namespace lib) (name lib) (:git/sha coords)]))))) diff --git a/src/babashka/bbin/scripts/common.clj b/src/babashka/bbin/scripts/common.clj index b258e07..b4b5398 100644 --- a/src/babashka/bbin/scripts/common.clj +++ b/src/babashka/bbin/scripts/common.clj @@ -90,7 +90,7 @@ coords (val (first script-deps)) gitlibs-root (if-let [override (not-empty (System/getenv "GITLIBS"))] override - "~/.gitlibs")] + (str/join fs/file-separator [(fs/home) ".gitlibs"]))] (if (#{::no-lib} lib) (:local/root coords) (fs/expand-home (str/join fs/file-separator [gitlibs-root "libs" (namespace lib) (name lib) (:git/sha coords)])))))