Comparing version 0.11.0 to 0.11.1
@@ -18,9 +18,12 @@ 'use strict'; | ||
const pkgPath = pkgUp.sync(parentDir); | ||
opts = Object.assign({projectName: require(pkgPath).name}, opts); | ||
if (!opts.projectName) { | ||
opts = Object.assign({ | ||
// if the package.json was not found, avoid breaking with `require(null)` | ||
projectName: pkgPath && require(pkgPath).name | ||
}, opts); | ||
if (!opts.projectName && !opts.cwd) { | ||
throw new Error('Project name could not be inferred. Please specify the `projectName` option.'); | ||
} | ||
// add some tests for these options | ||
opts = Object.assign({ | ||
@@ -27,0 +30,0 @@ cwd: envPaths(opts.projectName).config, |
{ | ||
"name": "conf", | ||
"version": "0.11.0", | ||
"version": "0.11.1", | ||
"description": "Simple config handling for your app or module", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -75,2 +75,4 @@ # conf [![Build Status: Linux and macOS](https://travis-ci.org/sindresorhus/conf.svg?branch=master)](https://travis-ci.org/sindresorhus/conf) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/n88jwh3aju39i0p2/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/conf/branch/master) | ||
Overrides `projectName`. | ||
The only use-case I can think of is having the config located in the app directory or on some external storage. | ||
@@ -77,0 +79,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7826
85
144