Merge pull request #20174 from Homebrew/remove-migrated-symlinks

cask/installer: remove migration symlinks on uninstall
This commit is contained in:
Mike McQuaid 2025-06-26 14:52:14 +00:00 committed by GitHub
commit 4fd7c6fa8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View File

@ -792,10 +792,10 @@ on_request: true)
if installed_caskfile&.exist? if installed_caskfile&.exist?
begin begin
@cask = CaskLoader.load(installed_caskfile) @cask = CaskLoader.load_from_installed_caskfile(installed_caskfile)
return return
rescue CaskInvalidError rescue CaskInvalidError, CaskUnavailableError
# could be caused by trying to load outdated caskfile # could be caused by trying to load outdated or deleted caskfile
end end
end end

View File

@ -80,7 +80,6 @@ module Cask
when ".json" when ".json"
json = JSON.parse(path.read) json = JSON.parse(path.read)
json["token"] = new_token json["token"] = new_token
json["old_tokens"] = [old_token, *json["old_tokens"]].compact.uniq
path.atomic_write json.to_json path.atomic_write json.to_json
end end
end end