change line splitting method
This commit is contained in:
parent
3bdab156c2
commit
3869bf156c
@ -145,6 +145,16 @@ module Cask
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def find_launchctl_with_wildcard(search)
|
||||||
|
regex = Regexp.escape(search).gsub("\\*", ".*")
|
||||||
|
system_command!("/bin/launchctl", args: ["list"])
|
||||||
|
.stdout.lines.drop(1) # skip stdout column headers
|
||||||
|
.map do |line|
|
||||||
|
pid, _state, id = line.chomp.split(/\s+/)
|
||||||
|
id if pid.to_i.nonzero? && id.match?(regex)
|
||||||
|
end.compact
|
||||||
|
end
|
||||||
|
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def automation_access_instructions
|
def automation_access_instructions
|
||||||
<<~EOS
|
<<~EOS
|
||||||
@ -282,16 +292,6 @@ module Cask
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_launchctl_with_wildcard(search)
|
|
||||||
regex = Regexp.escape(search).gsub("\\*", ".*")
|
|
||||||
system_command!("/bin/launchctl", args: ["list"])
|
|
||||||
.stdout.lines.drop(1) # skip stdout column headers
|
|
||||||
.map do |line|
|
|
||||||
pid, _state, id = line.chomp.split("\t")
|
|
||||||
id if pid.to_i.nonzero? && id.match?(regex)
|
|
||||||
end.compact
|
|
||||||
end
|
|
||||||
|
|
||||||
# :kext should be unloaded before attempting to delete the relevant file
|
# :kext should be unloaded before attempting to delete the relevant file
|
||||||
def uninstall_kext(*kexts, command: nil, **_)
|
def uninstall_kext(*kexts, command: nil, **_)
|
||||||
kexts.each do |kext|
|
kexts.each do |kext|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user