From e078becf4f3b7beaedea35e664a8c3562331ab3e Mon Sep 17 00:00:00 2001 From: commitay Date: Sun, 21 Jan 2018 19:10:30 +1000 Subject: cask move_back: copy / delete --- Library/Homebrew/cask/lib/hbc/artifact/moved.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Library/Homebrew/cask') 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, **_) -- cgit v1.2.3 From b864ae7b408741338f0016d686857fc0fe545fe2 Mon Sep 17 00:00:00 2001 From: commitay Date: Wed, 14 Feb 2018 07:56:59 +1000 Subject: backing up --- Library/Homebrew/cask/lib/hbc/artifact/moved.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library/Homebrew/cask') diff --git a/Library/Homebrew/cask/lib/hbc/artifact/moved.rb b/Library/Homebrew/cask/lib/hbc/artifact/moved.rb index 5a7483543..31cede71a 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/moved.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/moved.rb @@ -62,7 +62,7 @@ module Hbc raise CaskError, "It seems the #{self.class.english_name} source '#{target}' is not there." end - ohai "Copying #{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? -- cgit v1.2.3