brew/Library/Homebrew/cask/artifact/keyboard_layout.rb
EricFromCanada b9dab243b5
cask/artifact: fix up some definitions
And expand the list of artifacts that target: works with.
2023-04-14 15:47:33 -04:00

32 lines
706 B
Ruby

# typed: true
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
# Artifact corresponding to the `keyboard_layout` stanza.
#
# @api private
class KeyboardLayout < Moved
extend T::Sig
def install_phase(**options)
super(**options)
delete_keyboard_layout_cache(**options)
end
def uninstall_phase(**options)
super(**options)
delete_keyboard_layout_cache(**options)
end
private
def delete_keyboard_layout_cache(command: nil, **_)
command.run!("/bin/rm", args: ["-f", "--", "/System/Library/Caches/com.apple.IntlDataCache.le*"], sudo: true)
end
end
end
end