Skip to content

Commit

Permalink
Fix compatibility with vercel/ncc (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
Idered committed Aug 29, 2020
1 parent ebe00a1 commit 71d640e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -12,7 +12,7 @@ const normalizePackageData = require('normalize-package-data');

// Prevent caching of this module so module.parent is always accurate
delete require.cache[__filename];
const parentDir = path.dirname(module.parent.filename);
const parentDir = path.dirname(module.parent && module.parent.filename ? module.parent.filename : '.');

const isFlagMissing = (flagName, definedFlags, receivedFlags, input) => {
const flag = definedFlags[flagName];
Expand Down Expand Up @@ -153,7 +153,7 @@ const meow = (helpText, options) => {

const showVersion = () => {
console.log(typeof options.version === 'string' ? options.version : pkg.version);
process.exit();
process.exit(0);
};

if (argv._.length === 0 && options.argv.length === 1) {
Expand Down

0 comments on commit 71d640e

Please sign in to comment.