@oclif/core 1.16.0 → 1.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.16.1](https://github.com/oclif/core/compare/v1.16.0...v1.16.1) (2022-09-08)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * support environment variables for boolean flags ([#488](https://github.com/oclif/core/issues/488)) ([#490](https://github.com/oclif/core/issues/490)) ([506945c](https://github.com/oclif/core/commit/506945c6ea2f8b75f0d56ad1f6e62a3717384a42)), closes [#487](https://github.com/oclif/core/issues/487)
11
+
5
12
  ## [1.16.0](https://github.com/oclif/core/compare/v1.15.0...v1.16.0) (2022-08-24)
6
13
 
7
14
 
@@ -169,12 +169,18 @@ class Parser {
169
169
  const flag = this.input.flags[k];
170
170
  if (flags[k])
171
171
  continue;
172
- if (flag.type === 'option' && flag.env) {
172
+ if (flag.env) {
173
173
  const input = process.env[flag.env];
174
- if (input) {
175
- this._validateOptions(flag, input);
176
- // eslint-disable-next-line no-await-in-loop
177
- flags[k] = await flag.parse(input, this.context, flag);
174
+ if (flag.type === 'option') {
175
+ if (input) {
176
+ this._validateOptions(flag, input);
177
+ // eslint-disable-next-line no-await-in-loop
178
+ flags[k] = await flag.parse(input, this.context, flag);
179
+ }
180
+ }
181
+ else if (flag.type === 'boolean') {
182
+ // eslint-disable-next-line no-negated-condition
183
+ flags[k] = input !== undefined ? ['true', 'TRUE', '1', 'yes', 'YES', 'y', 'Y'].includes(input) : false;
178
184
  }
179
185
  }
180
186
  if (!(k in flags) && flag.default !== undefined) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oclif/core",
3
3
  "description": "base library for oclif CLIs",
4
- "version": "1.16.0",
4
+ "version": "1.16.1",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {