Skip to content

Commit

Permalink
throw exception when mv source does not exist; fixes #325
Browse files Browse the repository at this point in the history
  • Loading branch information
martinklepsch committed Oct 28, 2015
1 parent 5fdd501 commit 6d89dc7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions boot/pod/src/boot/tmpdir.clj
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@
(mv [this from-path to-path]
(if (= from-path to-path)
this
(if-let [f (assoc (get-in this [:tree from-path]) :path to-path)]
(update-in this [:tree] #(-> % (assoc to-path f) (dissoc from-path)))
(if-let [from (get-in this [:tree from-path])]
(update-in this [:tree] #(-> % (assoc to-path (assoc from :path to-path))
(dissoc from-path)))
(throw (Exception. (format "not in fileset (%s)" from-path))))))
(cp [this src-file dest-tmpfile]
(let [hash (digest/md5 src-file)
Expand Down

0 comments on commit 6d89dc7

Please sign in to comment.