Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for option to suppress exit messages #2639

Open
beau-townsend opened this issue Oct 16, 2024 · 2 comments
Open

Request for option to suppress exit messages #2639

beau-townsend opened this issue Oct 16, 2024 · 2 comments

Comments

@beau-townsend
Copy link

Platform

( ) MacOS
(x) Linux
( ) WSL2

Installed Via

( ) Homebrew
( ) Apt Package
( ) Manually
(x) Lando

PHP Version

( ) 7.4x
(x) 8.0
( ) 8.1

Terminus Version

3.3.5

Command Executed

terminus composer cwb-1testsite.dev -- show drupal/autologout --format=json

Expected behavior

Output that is faithful to the originally executed command, without additional unexpected output.

Actual behavior

When executing composer commands an exit message like " [notice] Command: cwb-1testsite.dev -- composer show drupal/autologout [Exit: 0]" is posted at the end of the output. This interferes with the ability to use a tool like jq to parse the results.
image

@MichaelFisher1997
Copy link

I really hope this gets looked into.
even at least format it so we can easily extract a return value.
I want to run remote drush and receive a value, its really a pain having this.

@beau-townsend
Copy link
Author

FWIW, you can get around this with drush commands by invoking drush aliases.

To get set up:

  1. First we need the aliases. If your platform contains many sites, this could take up to 5+ minutes.
# Retrieve all aliases.
terminus alias

# Validate aliases.
drush sa
  1. Ensure you have git mode warnings suppressed. The following environment variable must exist:
    TERMINUS_HIDE_GIT_MODE_WARNING: 1

You can either create this env var manually, inject it from your rc file or, if you use lando like me, add this under the overrides/environment keys:

services:
 appserver:
   overrides:
     environment:
       TERMINUS_HIDE_GIT_MODE_WARNING: 1
  1. Execute your drush command via alias
drush @pantheon.my-site-name.dev -- eval '<do stuff here>'

For all other terminus commands, I know of no similar workaround. For my use case, I need to be able to inspect the results of composer commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants