From a01deaaf5211fef95df07b772b110311178f1964 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sat, 26 Dec 2020 14:01:22 +0100 Subject: [PATCH] Handle running apps in `application...` format. --- Library/Homebrew/cask/artifact/abstract_uninstall.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cask/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/artifact/abstract_uninstall.rb index c669999d15..9a67669be3 100644 --- a/Library/Homebrew/cask/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/artifact/abstract_uninstall.rb @@ -123,11 +123,11 @@ module Cask def running_processes(bundle_id) system_command!("/bin/launchctl", args: ["list"]) - .stdout.lines + .stdout.lines.drop(1) .map { |line| line.chomp.split("\t") } .map { |pid, state, id| [pid.to_i, state.to_i, id] } .select do |(pid, _, id)| - pid.nonzero? && /^#{Regexp.escape(bundle_id)}($|\.\d+)/.match?(id) + pid.nonzero? && /\A(?:application\.)?#{Regexp.escape(bundle_id)}(?:\.\d+){0,2}\Z/.match?(id) end end