35 lines
670 B
Ruby
Raw Normal View History

# typed: true
# frozen_string_literal: true
require "cask/artifact/moved"
2016-08-18 22:11:42 +03:00
2018-09-06 08:29:14 +02:00
module Cask
2016-09-24 13:52:43 +02:00
module Artifact
2020-08-19 10:23:41 +02:00
# Artifact corresponding to the `qlplugin` stanza.
#
# @api private
2016-09-24 13:52:43 +02:00
class Qlplugin < Moved
2020-10-20 12:03:48 +02:00
sig { returns(String) }
def self.english_name
2016-09-24 13:52:43 +02:00
"QuickLook Plugin"
end
2016-08-18 22:11:42 +03:00
def install_phase(**options)
super(**options)
reload_quicklook(**options)
2016-09-24 13:52:43 +02:00
end
2016-08-18 22:11:42 +03:00
def uninstall_phase(**options)
super(**options)
reload_quicklook(**options)
2016-09-24 13:52:43 +02:00
end
2016-08-18 22:11:42 +03:00
private
def reload_quicklook(command: nil, **_)
command.run!("/usr/bin/qlmanage", args: ["-r"])
2016-09-24 13:52:43 +02:00
end
end
2016-08-18 22:11:42 +03:00
end
end