Skip to content
Snippets Groups Projects
Unverified Commit 3a21ca89 authored by Dario Vladovic's avatar Dario Vladovic
Browse files

Implement `mdimporter` cask stanza

parent 842d92a6
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@ require "cask/artifact/postflight_block"
require "cask/artifact/preflight_block"
require "cask/artifact/prefpane"
require "cask/artifact/qlplugin"
require "cask/artifact/mdimporter"
require "cask/artifact/screen_saver"
require "cask/artifact/service"
require "cask/artifact/stage_only"
......
......@@ -62,6 +62,7 @@ module Cask
Colorpicker,
Prefpane,
Qlplugin,
Mdimporter,
Dictionary,
Font,
Service,
......
# frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
class Mdimporter < Moved
def self.english_name
"Spotlight metadata importer"
end
def install_phase(**options)
super(**options)
reload_spotlight(**options)
end
private
def reload_spotlight(command: nil, **_)
command.run!("/usr/bin/mdimport", args: ["-r", target])
end
end
end
end
......@@ -53,6 +53,7 @@ module Cask
option "--colorpickerdir=PATH", ->(value) { Config.global.colorpickerdir = value }
option "--prefpanedir=PATH", ->(value) { Config.global.prefpanedir = value }
option "--qlplugindir=PATH", ->(value) { Config.global.qlplugindir = value }
option "--mdimporterdir=PATH", ->(value) { Config.global.mdimporterdir = value }
option "--dictionarydir=PATH", ->(value) { Config.global.dictionarydir = value }
option "--fontdir=PATH", ->(value) { Config.global.fontdir = value }
option "--servicedir=PATH", ->(value) { Config.global.servicedir = value }
......
......@@ -11,6 +11,7 @@ module Cask
appdir: "/Applications",
prefpanedir: "~/Library/PreferencePanes",
qlplugindir: "~/Library/QuickLook",
mdimporterdir: "~/Library/Spotlight",
dictionarydir: "~/Library/Dictionaries",
fontdir: "~/Library/Fonts",
colorpickerdir: "~/Library/ColorPickers",
......
......@@ -39,6 +39,7 @@ module Cask
Artifact::Pkg,
Artifact::Prefpane,
Artifact::Qlplugin,
Artifact::Mdimporter,
Artifact::ScreenSaver,
Artifact::Service,
Artifact::StageOnly,
......
......@@ -27,6 +27,7 @@ module RuboCop
:internet_plugin,
:prefpane,
:qlplugin,
:mdimporter,
:screen_saver,
:service,
:audio_unit_plugin,
......
......@@ -14,6 +14,7 @@ module Cask
appdir: Pathname(TEST_TMPDIR)/"cask-appdir",
prefpanedir: Pathname(TEST_TMPDIR)/"cask-prefpanedir",
qlplugindir: Pathname(TEST_TMPDIR)/"cask-qlplugindir",
mdimporterdir: Pathname(TEST_TMPDIR)/"cask-mdimporter",
dictionarydir: Pathname(TEST_TMPDIR)/"cask-dictionarydir",
fontdir: Pathname(TEST_TMPDIR)/"cask-fontdir",
colorpickerdir: Pathname(TEST_TMPDIR)/"cask-colorpickerdir",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment