cask moved: check target writable for move_back

This commit is contained in:
commitay 2018-01-13 20:54:17 +10:00
parent 651988bf55
commit 8bf9484823

View File

@ -65,7 +65,7 @@ module Hbc
ohai "Moving #{self.class.english_name} '#{target.basename}' back to '#{source}'." ohai "Moving #{self.class.english_name} '#{target.basename}' back to '#{source}'."
source.dirname.mkpath source.dirname.mkpath
if source.parent.writable? if target.parent.writable?
FileUtils.move(target, source) FileUtils.move(target, source)
else else
command.run("/bin/mv", args: [target, source], sudo: true) command.run("/bin/mv", args: [target, source], sudo: true)