Skip to content

Commit

Permalink
prefix only replaced in file if followed by...
Browse files Browse the repository at this point in the history
... whitespace or '.'
  • Loading branch information
benedekfazekas committed Apr 5, 2015
1 parent 64bf0ac commit 3685d0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/leiningen/source_deps.clj
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
(defn- update-file [file prefixes prefix]
(let [old (slurp file)
new (-> (str/replace old (re-pattern (str "(\\[\\s*)" prefix "(\\s+\\[?)")) (str "$1" (prefixes prefix) "$2"))
(str/replace (re-pattern (str "(\\s+)" prefix)) (str "$1" (prefixes prefix))))]
(str/replace (re-pattern (str "(\\s+)" prefix "([\\s\\.])")) (str "$1" (prefixes prefix) "$2")))]
(when-not (= old new)
(spit file new))))

Expand Down

0 comments on commit 3685d0c

Please sign in to comment.