From 8bf948482325bdc10ab7d0eff75ce0da4d5daf1c Mon Sep 17 00:00:00 2001 From: commitay Date: Sat, 13 Jan 2018 20:54:17 +1000 Subject: [PATCH] cask moved: check target writable for move_back --- Library/Homebrew/cask/lib/hbc/artifact/moved.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cask/lib/hbc/artifact/moved.rb b/Library/Homebrew/cask/lib/hbc/artifact/moved.rb index f5ef790ebb..856ab2766f 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/moved.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/moved.rb @@ -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)