Skip to content

Commit

Permalink
make more robust for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Jul 27, 2023
1 parent dc8da7a commit 1213418
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
org.clojure/tools.deps {:mvn/version "0.16.1264"}
org.slf4j/slf4j-jdk14 {:mvn/version "1.7.9"}
javax.xml.bind/jaxb-api {:mvn/version "2.3.1"}
nrepl/bencode {:mvn/version "1.1.0"}}
nrepl/bencode {:mvn/version "1.1.0"}
babashka/fs {:mvn/version "0.4.19"}}
:paths ["src" "resources"]
:aliases {:compile-main
{:main-opts ["-e" "(compile 'borkdude.tdn.main)"]
Expand Down
2 changes: 2 additions & 0 deletions reflect-config-cleaned.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"name" : "[J"
}, {
"name" : "[Ljava.lang.Object;"
}, {
"name" : "[Ljava.nio.file.LinkOption;"
}, {
"name" : "[S"
}, {
Expand Down
2 changes: 1 addition & 1 deletion script/test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@

(shell native-executable "create-basis" '{:extra {:deps {buddy/buddy-core {:mvn/version "1.10.1"}}}})

(shell native-executable "create-basis" (edn/read-string (slurp "test/bbuild-issue-10-deps.edn")))
(shell native-executable "create-basis" (str (fs/file "test" "bbuild-issue-10-deps.edn")))

nil
6 changes: 4 additions & 2 deletions src/borkdude/tdn/cli.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
(:require
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.tools.deps :as deps]))
[clojure.tools.deps :as deps]
[babashka.fs :as fs]))

(def default-repos
{"central" {:url "https://repo1.maven.org/maven2/"}
Expand Down Expand Up @@ -75,6 +76,7 @@ Use tools-deps.edn help <cmd> to get more specific help"))

(defn create-basis [args]
(let [arg (first args)
arg (if (fs/exists? arg) (slurp arg) arg)
deps (edn/read-string arg)]
(if (map? deps)
(prn (-> deps
Expand All @@ -83,7 +85,7 @@ Use tools-deps.edn help <cmd> to get more specific help"))
deps/create-basis))
(binding [*out* *err*]
(throw
(ex-info (str"Invalid argument " deps ", expeccted a map") {}))))))
(ex-info (str"Invalid argument " deps ", expected a map") {}))))))
(defn deps [args]
(let [arg (first args)
Expand Down

0 comments on commit 1213418

Please sign in to comment.