cask moved: check target writable for move_back
This commit is contained in:
parent
651988bf55
commit
8bf9484823
@ -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)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user