diff options
| author | commitay | 2018-01-21 19:10:30 +1000 |
|---|---|---|
| committer | commitay | 2018-02-14 07:39:44 +1000 |
| commit | e078becf4f3b7beaedea35e664a8c3562331ab3e (patch) | |
| tree | 79f4eba84f7cc948a635e779267296a66b0df6b4 /Library/Homebrew/cask/lib/hbc/artifact/moved.rb | |
| parent | 2a41f1359e81a52082f93c109beb3506bced2250 (diff) | |
| download | brew-e078becf4f3b7beaedea35e664a8c3562331ab3e.tar.bz2 | |
cask move_back: copy / delete
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/artifact/moved.rb')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/artifact/moved.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/artifact/moved.rb b/Library/Homebrew/cask/lib/hbc/artifact/moved.rb index 856ab2766..5a7483543 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/moved.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/moved.rb @@ -62,14 +62,16 @@ module Hbc raise CaskError, "It seems the #{self.class.english_name} source '#{target}' is not there." end - ohai "Moving #{self.class.english_name} '#{target.basename}' back to '#{source}'." + ohai "Copying #{self.class.english_name} '#{target.basename}' back to '#{source}'." source.dirname.mkpath if target.parent.writable? - FileUtils.move(target, source) + FileUtils.cp_r(target, source) else - command.run("/bin/mv", args: [target, source], sudo: true) + command.run("/bin/cp", args: ["-r", target, source], sudo: true) end + + delete(target, force: force, command: command, **options) end def delete(target, force: false, command: nil, **_) |
