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

fix: pass json flag to plugins install #643

Merged
merged 1 commit into from
Nov 11, 2023
Merged

Conversation

shetzel
Copy link
Contributor

@shetzel shetzel commented Nov 10, 2023

What does this PR do?

If a JIT plugin command is run with --json and that plugin is not yet installed (such as in a CI system) the output from the JIT install (which is not JSON) would mix with the JSON to cause problems. This fix passes along the --json flag to the call to plugins:install so the output is still valid JSON.

E.g., sf package version create ... --json would cause output like:

Successfully installed @salesforce/plugin-packaging v1.27.0
  {
    "status": 0,
    "result": {
      "Id": "<PACKAGE_ID>",
      ...
    },
    "warnings": []
  }

With the fix, the output contains only JSON.

What issues does this PR fix or reference?

@W-14457843@
forcedotcom/cli#2562

@mshanemc
Copy link
Contributor

QA:

(unintentionally): wrote a command that errored out (wrong alias).
✅ good json error to stdout, everything else to stderr.

correct command
✅ good json output to stdout

📓 warnings are going to stderr. sfCommand usually gets these into the warnings of its json, but here we're losing them. Acceptable given the circumstances, worth considering in the future.

@mshanemc mshanemc merged commit c8157ec into main Nov 11, 2023
12 checks passed
@mshanemc mshanemc deleted the sh/jit-install-json branch November 11, 2023 00:14
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

Successfully merging this pull request may close these issues.

2 participants