Skip to content

Commit

Permalink
fix: Add dirname sanity check on findUp (#1036)
Browse files Browse the repository at this point in the history
  • Loading branch information
soimy authored and bcoe committed Jan 3, 2018
1 parent 0942a15 commit 331d103
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yargs.js
Expand Up @@ -502,7 +502,7 @@ function Yargs (processArgs, cwd, parentRequire) {
let obj = {}
try {
const pkgJsonPath = findUp.sync('package.json', {
cwd: path || require('require-main-filename')(parentRequire || require),
cwd: path || require('path').dirname(require('require-main-filename')(parentRequire || require)),
normalize: false
})
obj = JSON.parse(fs.readFileSync(pkgJsonPath))
Expand Down

0 comments on commit 331d103

Please sign in to comment.