-
Notifications
You must be signed in to change notification settings - Fork 70
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: allow CONTENT_TYPE env to work for all oclif cmds #753
Conversation
|
||
// mock a scopedEnvVar being set to JSON | ||
const cmd = new CMD([], { | ||
bin: 'FOO', scopedEnvVar: (foo: string) => foo.includes('CONTENT_TYPE') ? 'json' : undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's an .env()
on fancy-test that lets you set env vars if you prefer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that didn't work when I tried it
QA Notes
➜ SF_CONTENT_TYPE=json sf version
{
"cliVersion": "@salesforce/cli/2.1.7",
"architecture": "darwin-arm64",
"nodeVersion": "node-v18.16.0"
} ✅ : ➜ plugin-version git:(main) 🔗1
➜ SF_CONTENT_TYPE=json sf version | jq .cliVersion
"@salesforce/cli/2.1.7" ✅ : confirmed NOT working in ➜ SF_CONTENT_TYPE=json sf commands
Command Summary
───────────────────────────────────── ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
alias list List all aliases currently set on your local computer. ✅ : working after linking ➜ SF_CONTENT_TYPE=json sf commands
[
{
"id": "alias:list", ✅ : ➜ SF_CONTENT_TYPE=json sf commands|jq '.[0].id'
"alias:list" ✅ : doesn't override flag ➜ SF_CONTENT_TYPE=notjson sf commands --json|jq '.[0].id'
"alias:list" |
read CONTENT_TYPE=json from the env
forcedotcom/cli#2331
@W-13848014@
before/after
QA:
compile this
yarn link into oclif/plugin-version
sf plugins link . (inside oclif/plugin-version). This is needed to get the
SF
into the scopedEnvVars. Otherwise (bin/dev), you've got to do it with the plugin, but note that the@ | /| -
are transformed by oclif config/scopedEnvVarsSF_CONTENT_TYPE=json sf version