Skip to content

Commit

Permalink
Disable the extensions performed by fs
Browse files Browse the repository at this point in the history
These could affect end-users.

Fixes #355
  • Loading branch information
vemv committed Dec 14, 2021
1 parent da81035 commit 6a78cc1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
^:inline-dep [org.clojure/tools.reader "1.3.6"]
^:inline-dep [cider/orchard "0.7.3"]
^:inline-dep [cljfmt "0.8.0" :exclusions [rewrite-clj rewrite-cljs]]
^:inline-dep [clj-commons/fs "1.6.307"]
^:inline-dep [clj-commons/fs "1.6.310"]
^:inline-dep [rewrite-clj "1.0.699-alpha"]
^:inline-dep [version-clj "1.0.0"]]
:exclusions [org.clojure/clojure] ; see versions matrix below
Expand Down
5 changes: 4 additions & 1 deletion src/refactor_nrepl/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
[clojure.string :as str]
[clojure.tools.namespace.parse :as parse]
[clojure.tools.reader.reader-types :as readers]
[me.raynes.fs :as fs]
[orchard.java.classpath :as cp]
[orchard.misc :as misc]
[refactor-nrepl.config :as config]
Expand All @@ -13,6 +12,10 @@
(:import
(java.io File FileReader PushbackReader StringReader)))

;; Require our `fs` customizations before `fs` is loaded:
(require '[refactor-nrepl.fs])
(require '[me.raynes.fs :as fs])

(defn version []
(let [v (-> (or (io/resource "refactor-nrepl/refactor-nrepl/project.clj")
"project.clj")
Expand Down
7 changes: 7 additions & 0 deletions src/refactor_nrepl/fs.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(ns refactor-nrepl.fs
"Sets the compile-time feature-flags from the `fs` library.
This ns should be `require`d before any other `fs` ns."
(:require
[me.raynes.fs.feature-flags]))

(alter-var-root #'me.raynes.fs.feature-flags/extend-coercions? (constantly false))
4 changes: 4 additions & 0 deletions src/refactor_nrepl/rename_file_or_dir.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
(java.nio.file Files)
(java.util.regex Pattern)))

;; Require our `fs` customizations before `fs` is loaded:
(require '[refactor-nrepl.fs])
(require '[me.raynes.fs :as fs])

(declare -rename-file-or-dir)

(defn- chop-src-dir-prefix
Expand Down

0 comments on commit 6a78cc1

Please sign in to comment.