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: set find config "home: true" #224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/read-config-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ const log = require('./logger');

const readConfigFile = (CZ_CONFIG_NAME = '.cz-config.js') => {
// First try to find the .cz-config.js config file
// It seems like find-config still locates config files in the home directory despite of the home:false prop.
const czConfig = findConfig.require(CZ_CONFIG_NAME, { home: false });
const czConfig = findConfig.require(CZ_CONFIG_NAME, { home: true });

if (czConfig) {
return czConfig;
}

// fallback to locating it using the config block in the nearest package.json
let pkg = findConfig('package.json', { home: false });
let pkg = findConfig('package.json', { home: true });

if (pkg) {
const pkgDir = path.dirname(pkg);
Expand Down