Skip to content

Commit

Permalink
try again
Browse files Browse the repository at this point in the history
  • Loading branch information
rads committed May 5, 2024
1 parent cf94327 commit f22462f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions bbin
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ WARNING: (We won't make any changes without asking you first.)

(defn- local-script-path? [x]
(boolean (and (string? x) (or (fs/exists? x)
(fs/exists? (str/replace x #"^file://" ""))))))
(fs/exists? (str/replace x #"^file:(//|\\\\)" ""))))))

(defn- http-url? [x]
(boolean (and (string? x) (re-seq #"^https?://" x))))
Expand Down Expand Up @@ -378,7 +378,7 @@ WARNING: (We won't make any changes without asking you first.)

(or (and (#{:local} procurer) (and (:script/lib cli-opts)
(or (fs/regular-file? (:script/lib cli-opts))
(fs/regular-file? (str/replace (:script/lib cli-opts) #"^file://" "")))))
(fs/regular-file? (str/replace (:script/lib cli-opts) #"^file:(//|\\\\)" "")))))
(and (#{:http} procurer) (re-seq #"\.(cljc?|bb)$" (:script/lib cli-opts))))
:file

Expand Down Expand Up @@ -1392,7 +1392,7 @@ WARNING: (We won't make any changes without asking you first.)

(upgrade [_]
(let [cli-opts' (merge (select-keys cli-opts [:edn])
{:script/lib (str/replace (:bbin/url coords) #"^file://" "")})]
{:script/lib (str/replace (:bbin/url coords) #"^file:(//|\\\\)" "")})]
(p/install (map->LocalFile {:cli-opts cli-opts'
:coords coords}))))

Expand Down Expand Up @@ -1457,7 +1457,7 @@ WARNING: (We won't make any changes without asking you first.)

(upgrade [_]
(let [cli-opts' (merge (select-keys cli-opts [:edn])
{:script/lib (str/replace (:bbin/url coords) #"^file://" "")})]
{:script/lib (str/replace (:bbin/url coords) #"^file:(//|\\\\)" "")})]
(p/install (map->LocalJar {:cli-opts cli-opts'
:coords coords}))))

Expand Down
4 changes: 2 additions & 2 deletions src/babashka/bbin/deps.clj
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

(defn- local-script-path? [x]
(boolean (and (string? x) (or (fs/exists? x)
(fs/exists? (str/replace x #"^file:(//|\\)" ""))))))
(fs/exists? (str/replace x #"^file:(//|\\\\)" ""))))))

(defn- http-url? [x]
(boolean (and (string? x) (re-seq #"^https?://" x))))
Expand Down Expand Up @@ -183,7 +183,7 @@

(or (and (#{:local} procurer) (and (:script/lib cli-opts)
(or (fs/regular-file? (:script/lib cli-opts))
(fs/regular-file? (str/replace (:script/lib cli-opts) #"^file:(//|\\)" "")))))
(fs/regular-file? (str/replace (:script/lib cli-opts) #"^file:(//|\\\\)" "")))))
(and (#{:http} procurer) (re-seq #"\.(cljc?|bb)$" (:script/lib cli-opts))))
:file

Expand Down
2 changes: 1 addition & 1 deletion src/babashka/bbin/scripts/local_file.clj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

(upgrade [_]
(let [cli-opts' (merge (select-keys cli-opts [:edn])
{:script/lib (str/replace (:bbin/url coords) #"^file:(//|\\)" "")})]
{:script/lib (str/replace (:bbin/url coords) #"^file:(//|\\\\)" "")})]
(p/install (map->LocalFile {:cli-opts cli-opts'
:coords coords}))))

Expand Down
2 changes: 1 addition & 1 deletion src/babashka/bbin/scripts/local_jar.clj
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

(upgrade [_]
(let [cli-opts' (merge (select-keys cli-opts [:edn])
{:script/lib (str/replace (:bbin/url coords) #"^file:(//|\\)" "")})]
{:script/lib (str/replace (:bbin/url coords) #"^file:(//|\\\\)" "")})]
(p/install (map->LocalJar {:cli-opts cli-opts'
:coords coords}))))

Expand Down

0 comments on commit f22462f

Please sign in to comment.