Merge pull request #3680 from commitay/moved-permissions

cask moved: check target writable for move_back
This commit is contained in:
Markus Reiter 2018-01-15 15:28:55 +01:00 committed by GitHub
commit f90e6f82c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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