Skip to content

Commit 3adfb28

Browse files
committed
make tools dir tests dependent on environment
1 parent 0844cdd commit 3adfb28

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

test/clojure/tools/tools/api_test.clj

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,20 @@
6767

6868
(defmacro let-tools-dir
6969
[[dir-sym dir-path] & body]
70-
`(let [tmp# (jio/file (System/getProperty "java.io.tmpdir") (str (UUID/randomUUID)))
71-
tools# (jio/file tmp# ".clojure" "tools")
72-
old-home# (System/getProperty "user.home")
73-
~dir-sym (.getAbsolutePath tools#)]
74-
(try
75-
(.mkdirs tools#)
76-
(.deleteOnExit tmp#)
77-
(copy-dir ~dir-path (.getAbsolutePath tools#))
78-
(System/setProperty "user.home" (.getAbsolutePath tmp#))
79-
~@body
80-
(finally
81-
(System/setProperty "user.home" old-home#)))))
82-
83-
(println "!! env paths" (System/getenv "CLJ_CONFIG") (System/getenv "XDG_CONFIG_HOME"))
70+
(if (or (System/getenv "CLJ_CONFIG") (System/getenv "XDG_CONFIG_HOME"))
71+
(println "Skipping let-tools-dir test due to environment")
72+
`(let [tmp# (jio/file (System/getProperty "java.io.tmpdir") (str (UUID/randomUUID)))
73+
tools# (jio/file tmp# ".clojure" "tools")
74+
old-home# (System/getProperty "user.home")
75+
~dir-sym (.getAbsolutePath tools#)]
76+
(try
77+
(.mkdirs tools#)
78+
(.deleteOnExit tmp#)
79+
(copy-dir ~dir-path (.getAbsolutePath tools#))
80+
(System/setProperty "user.home" (.getAbsolutePath tmp#))
81+
~@body
82+
(finally
83+
(System/setProperty "user.home" old-home#))))))
8484

8585
;; when new tool has both git and maven versions, prefer git and install
8686
(deftest install-latest-new-mixed

0 commit comments

Comments
 (0)