aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib
diff options
context:
space:
mode:
authorcommitay2018-02-21 07:47:43 +1000
committerGitHub2018-02-21 07:47:43 +1000
commitbab4bb68ee8299692a91640750e75fc5ad8049da (patch)
treee9a4af288448c5f11b74ca5638a7eccf6a9b6d19 /Library/Homebrew/cask/lib
parent2c84c04bd4eefc050f400659ff7e9dd1aba3cfb9 (diff)
parentb864ae7b408741338f0016d686857fc0fe545fe2 (diff)
downloadbrew-bab4bb68ee8299692a91640750e75fc5ad8049da.tar.bz2
Merge pull request #3715 from commitay/moved
cask move_back: copy / delete
Diffstat (limited to 'Library/Homebrew/cask/lib')
-rw-r--r--Library/Homebrew/cask/lib/hbc/artifact/moved.rb8
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..31cede71a 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 "Backing #{self.class.english_name} '#{target.basename}' up 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, **_)