Skip to content

Commit

Permalink
[#7] fix differences with -Sdescribe
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Jan 20, 2020
1 parent d9a74b8 commit 4ffe274
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 20 deletions.
25 changes: 15 additions & 10 deletions deps.clj
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ For more info, see:
(defn describe [lines]
(let [[first-line & lines] lines]
(print "{") (describe-line first-line)
(doseq [line lines]
(doseq [line lines
:when line]
(print "\n ") (describe-line line))
(println "}")))

Expand Down Expand Up @@ -305,7 +306,7 @@ function Get-StringHash($str) {
(when-not (.exists config-dir)
(.mkdirs config-dir)))
(let [config-deps-edn (io/file config-dir "deps.edn")]
(when (and (not (.exists config-deps-edn)) install-dir)
(when (and install-dir (not (.exists config-deps-edn)))
(io/copy (io/file install-dir "example-deps.edn")
config-deps-edn)))
;; Determine user cache directory
Expand All @@ -321,10 +322,14 @@ function Get-StringHash($str) {
config-project deps-edn
config-paths
(if (:repro args)
[(.getPath (io/file install-dir "deps.edn")) deps-edn]
[(.getPath (io/file install-dir "deps.edn"))
(.getPath (io/file config-dir "deps.edn"))
deps-edn])
(if install-dir [(.getPath (io/file install-dir "deps.edn")) deps-edn]
[])
(if install-dir
[(.getPath (io/file install-dir "deps.edn"))
(.getPath (io/file config-dir "deps.edn"))
deps-edn]
[(.getPath (io/file config-dir "deps.edn"))
deps-edn]))
;; Determine whether to use user or project cache
cache-dir
(if (.exists (io/file "deps.edn"))
Expand Down Expand Up @@ -352,7 +357,7 @@ function Get-StringHash($str) {
_ (when (:verbose args)
(println "deps.clj version =" deps-clj-version)
(println "version =" version)
(println "install_dir =" install-dir)
(when install-dir (println "install_dir =" install-dir))
(println "config_dir =" config-dir)
(println "config_paths =" (str/join " " config-paths))
(println "cache_dir =" cache-dir)
Expand Down Expand Up @@ -422,10 +427,10 @@ function Get-StringHash($str) {
[:config-files (filterv #(.exists (io/file %)) config-paths)]
[:config-user config-user]
[:config-project config-project]
[:install-dir install-dir]
(when install-dir [:install-dir install-dir])
[:cache-dir cache-dir]
[:force (str (:force args))]
[:repro (str (:repro args))]
[:force (boolean (:force args))]
[:repro (boolean (:repro args))]
[:resolve-aliases (str (:resolve-aliases args))]
[:classpath-aliases (str (:claspath-aliases args))]
[:jvm-aliases (str (:jvm-aliases args))]
Expand Down
25 changes: 15 additions & 10 deletions src/borkdude/deps.clj
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ For more info, see:
(defn describe [lines]
(let [[first-line & lines] lines]
(print "{") (describe-line first-line)
(doseq [line lines]
(doseq [line lines
:when line]
(print "\n ") (describe-line line))
(println "}")))

Expand Down Expand Up @@ -305,7 +306,7 @@ function Get-StringHash($str) {
(when-not (.exists config-dir)
(.mkdirs config-dir)))
(let [config-deps-edn (io/file config-dir "deps.edn")]
(when (and (not (.exists config-deps-edn)) install-dir)
(when (and install-dir (not (.exists config-deps-edn)))
(io/copy (io/file install-dir "example-deps.edn")
config-deps-edn)))
;; Determine user cache directory
Expand All @@ -321,10 +322,14 @@ function Get-StringHash($str) {
config-project deps-edn
config-paths
(if (:repro args)
[(.getPath (io/file install-dir "deps.edn")) deps-edn]
[(.getPath (io/file install-dir "deps.edn"))
(.getPath (io/file config-dir "deps.edn"))
deps-edn])
(if install-dir [(.getPath (io/file install-dir "deps.edn")) deps-edn]
[])
(if install-dir
[(.getPath (io/file install-dir "deps.edn"))
(.getPath (io/file config-dir "deps.edn"))
deps-edn]
[(.getPath (io/file config-dir "deps.edn"))
deps-edn]))
;; Determine whether to use user or project cache
cache-dir
(if (.exists (io/file "deps.edn"))
Expand Down Expand Up @@ -352,7 +357,7 @@ function Get-StringHash($str) {
_ (when (:verbose args)
(println "deps.clj version =" deps-clj-version)
(println "version =" version)
(println "install_dir =" install-dir)
(when install-dir (println "install_dir =" install-dir))
(println "config_dir =" config-dir)
(println "config_paths =" (str/join " " config-paths))
(println "cache_dir =" cache-dir)
Expand Down Expand Up @@ -422,10 +427,10 @@ function Get-StringHash($str) {
[:config-files (filterv #(.exists (io/file %)) config-paths)]
[:config-user config-user]
[:config-project config-project]
[:install-dir install-dir]
(when install-dir [:install-dir install-dir])
[:cache-dir cache-dir]
[:force (str (:force args))]
[:repro (str (:repro args))]
[:force (boolean (:force args))]
[:repro (boolean (:repro args))]
[:resolve-aliases (str (:resolve-aliases args))]
[:classpath-aliases (str (:claspath-aliases args))]
[:jvm-aliases (str (:jvm-aliases args))]
Expand Down

0 comments on commit 4ffe274

Please sign in to comment.