Skip to content

Commit

Permalink
Fix #120: use java.nio
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Dec 21, 2023
1 parent 11b1696 commit a043e8e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ DEPS_CLJ_TOOLS_VERSION=1.11.1.1165 bb clojure
## Unreleased

- Support older CPUs for native-image builds
- [#120](https://github.com/borkdude/deps.clj/issues/120): Use `java.nio` for writeable check rather than `java.io.File/canWrite`

## 1.11.1.1429

Expand Down
2 changes: 1 addition & 1 deletion src/borkdude/deps.clj
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ public class ClojureToolsDownloader {
(.getPath (io/file xdg-config-home "clojure")))
(.getPath (io/file config-dir ".cpcache")))]
(if (.exists (io/file deps-edn))
(if (-> (io/file (or *dir* ".")) (.canWrite))
(if (-> (io/file (or *dir* ".")) (.toPath) (java.nio.file.Files/isWritable))
{:cache-dir (.getPath (io/file *dir* ".cpcache"))
:cache-dir-key *dir*}
;; can't write to *dir*/.cpcache
Expand Down

0 comments on commit a043e8e

Please sign in to comment.