Skip to content

Add command to list running applications and their bundle IDs#257599

Open
hyuraku wants to merge 3 commits intoHomebrew:mainfrom
hyuraku:list-running-app-ids-to-cmd
Open

Add command to list running applications and their bundle IDs#257599
hyuraku wants to merge 3 commits intoHomebrew:mainfrom
hyuraku:list-running-app-ids-to-cmd

Conversation

@hyuraku
Copy link
Copy Markdown
Contributor

@hyuraku hyuraku commented Apr 4, 2026


After making any changes to a cask, existing or new, verify:

Additionally, if adding a new cask:

  • Named the cask according to the token reference.
  • Checked the cask was not already refused (add your cask's name to the end of the search field).
  • brew audit --cask --new <cask> worked successfully.
  • HOMEBREW_NO_INSTALL_FROM_API=1 brew install --cask <cask> worked successfully.
  • brew uninstall --cask <cask> worked successfully.

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes, including zap stanza paths.

Migrate developer/bin/list_running_app_ids to a proper Homebrew command at cmd/list-running-app-ids.rb, as part of #174192.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the developer/bin/list_running_app_ids standalone script into a proper brew tap command (list-running-app-ids), and updates existing tooling to call the new command as part of #174192.

Changes:

  • Removed the legacy developer/bin/list_running_app_ids script.
  • Added cmd/list-running-app-ids.rb implementing the new brew list-running-app-ids command.
  • Updated developer/bin/list_ids_in_app to use the new command for “is this bundle id running?” checks and documentation examples.

Reviewed changes

Copilot reviewed 1 out of 3 changed files in this pull request and generated 2 comments.

File Description
developer/bin/list_running_app_ids Removed in favor of a brew command implementation.
developer/bin/list_ids_in_app Switched running-app detection and docs from the removed script to brew list-running-app-ids.
cmd/list-running-app-ids.rb New Homebrew command that lists running apps and supports a bundle-id “test” mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +32 to +40
sig { override.void }
def run
app_names, bundle_ids = load_apps
test_bundle_id = args.named.first

if test_bundle_id
Homebrew.failed = true unless bundle_ids.include?(test_bundle_id)
else
report_apps(app_names, bundle_ids)
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a is provided, the command sets Homebrew.failed = true but does not explicitly return/exit non-zero. Within this repo’s other tap commands (e.g. cmd/find-appcast.rb), failure is indicated by the method’s boolean return value rather than setting a global flag. Please ensure brew list-running-app-ids <bundle-id> reliably exits with a non-zero status when the bundle id is not running (so callers like developer/bin/list_ids_in_app can detect it).

Suggested change
sig { override.void }
def run
app_names, bundle_ids = load_apps
test_bundle_id = args.named.first
if test_bundle_id
Homebrew.failed = true unless bundle_ids.include?(test_bundle_id)
else
report_apps(app_names, bundle_ids)
sig { override.returns(T::Boolean) }
def run
app_names, bundle_ids = load_apps
test_bundle_id = args.named.first
if test_bundle_id
running = bundle_ids.include?(test_bundle_id)
Homebrew.failed = true unless running
running
else
report_apps(app_names, bundle_ids)
true

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants