Skip to content

Commit

Permalink
fix: fixed a bug where default CLI options were overriding options fr…
Browse files Browse the repository at this point in the history
…om `.locorc` file
  • Loading branch information
robrechtme committed Dec 15, 2021
1 parent a5f3331 commit d21b2b4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<hr />

![npm](https://img.shields.io/npm/v/loco-cli)
[![npm](https://img.shields.io/npm/v/loco-cli)](https://www.npmjs.com/package/loco-cli)
![Dependencies](https://img.shields.io/librariesio/release/npm/loco-cli)
[![GitHub Issues](https://img.shields.io/github/issues/robrechtme/loco-cli.svg)](https://github.com/robrechtme/loco-cli/issues)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"devDependencies": {
"@types/cli-progress": "3.9.2",
"@types/node": "16.11.10",
"semantic-release": "^18.0.1",
"semantic-release": "18.0.1",
"typescript": "4.5.2"
}
}
}
6 changes: 2 additions & 4 deletions src/util/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@ export const getGlobalOptions = (program: Command): GlobalOptions => {
}

if (hasFileOptions) {
if (hasCLIOptions) {
console.log("🔍 Overwriting `.locorc` config with cli options");
} else {
if (!hasCLIOptions) {
console.log("🔍 Reading from `.locorc` config file");
}
}

// Note: merge deep when options will be nested
return {
...fileOptions,
...cliOptions,
...fileOptions,
};
};
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3124,7 +3124,7 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1:
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==

semantic-release@^18.0.1:
[email protected]:
version "18.0.1"
resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-18.0.1.tgz#df5ad44b9c2fd67fe3cdbc660b3d1f55298b9f34"
integrity sha512-xTdKCaEnCzHr+Fqyhg/5I8P9pvY9z7WHa8TFCYIwcdPbuzAtQShOTzw3VNPsqBT+Yq1kFyBQFBKBYkGOlqWmfA==
Expand Down

0 comments on commit d21b2b4

Please sign in to comment.