Add command to list running applications and their bundle IDs#257599
Add command to list running applications and their bundle IDs#257599hyuraku wants to merge 3 commits intoHomebrew:mainfrom
Conversation
There was a problem hiding this comment.
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_idsscript. - Added
cmd/list-running-app-ids.rbimplementing the newbrew list-running-app-idscommand. - Updated
developer/bin/list_ids_in_appto 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.
| 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) |
There was a problem hiding this comment.
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).
| 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 |
After making any changes to a cask, existing or new, verify:
brew audit --cask --online <cask>is error-free.brew style --fix <cask>reports no offenses.Additionally, if adding a new cask:
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.zapstanza paths.Migrate
developer/bin/list_running_app_idsto a proper Homebrew command atcmd/list-running-app-ids.rb, as part of #174192.