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

Isaacs/set envs fix #1652

Closed
wants to merge 2 commits into from
Closed

Isaacs/set envs fix #1652

wants to merge 2 commits into from

Conversation

isaacs
Copy link
Contributor

@isaacs isaacs commented Aug 11, 2020

Implement the changes in npm/rfcs#183, and set environment variables properly when they are not strings.

Also adds tests for the set-envs util.

@isaacs isaacs requested a review from a team as a code owner August 11, 2020 00:33
Copy link
Contributor

@MylesBorins MylesBorins left a comment

Choose a reason for hiding this comment

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

Rubber Stamp LGTM

Tested locally and it fixes the bug I was running into re: missing env var

}

const envVal = val => Array.isArray(val) ? val.join('\n\n') : val
const envVal = val => Array.isArray(val) ? val.map(v => envVal(v)).join('\n\n')
: val === null || val === undefined || val === false ? ''
Copy link
Contributor

Choose a reason for hiding this comment

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

o_O can we at least start nesting these? ex.

const envVal = val => Array.isArray(val) ? val.map(v => envVal(v)).join('\n\n')
  : val === null || val === undefined || val === false ? ''
    : typeof val === 'object' ? null
      : String(val)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We've moved to lining up the : for easier scanning down a straight left-edge, so the CLI matches all the other repos.

isaacs added a commit that referenced this pull request Aug 11, 2020
@isaacs
Copy link
Contributor Author

isaacs commented Aug 11, 2020

Landed and published on 7.0.0-beta.4.

@isaacs isaacs closed this Aug 11, 2020
@isaacs isaacs deleted the isaacs/set-envs-fix branch October 2, 2020 21:42
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.

3 participants