aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cask/lib/hbc/artifact/moved.rb2
-rw-r--r--Library/Homebrew/cask/lib/hbc/installer.rb7
2 files changed, 6 insertions, 3 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/artifact/moved.rb b/Library/Homebrew/cask/lib/hbc/artifact/moved.rb
index 11e019af2..dfd6008cf 100644
--- a/Library/Homebrew/cask/lib/hbc/artifact/moved.rb
+++ b/Library/Homebrew/cask/lib/hbc/artifact/moved.rb
@@ -71,7 +71,7 @@ module Hbc
command.run("/bin/mv", args: [target, source], sudo: true)
end
- add_altname_metadata(target, source.basename, command: command)
+ add_altname_metadata(source, target.basename, command: command)
end
def delete(target, force: false, command: nil, **_)
diff --git a/Library/Homebrew/cask/lib/hbc/installer.rb b/Library/Homebrew/cask/lib/hbc/installer.rb
index 84a8ac9b7..3dd2a7990 100644
--- a/Library/Homebrew/cask/lib/hbc/installer.rb
+++ b/Library/Homebrew/cask/lib/hbc/installer.rb
@@ -452,8 +452,11 @@ module Hbc
ohai "Purging files for version #{@cask.version} of Cask #{@cask}"
# versioned staged distribution
- staged_path = version_is_latest? ?
- backup_path(@cask.staged_path) : @cask.staged_path
+ if version_is_latest?
+ staged_path = backup_path(@cask.staged_path)
+ else
+ staged_path = @cask.staged_path
+ end
gain_permissions_remove(staged_path) if !staged_path.nil? && staged_path.exist?