Skip to content

Commit

Permalink
Fix circular calls to commons
Browse files Browse the repository at this point in the history
  • Loading branch information
eaviles committed Oct 21, 2021
1 parent 221affc commit f25f542
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const { description, homepage } = require('../package.json');
const learnMore = `Read the manual at ${homepage}`;
const { npm_lifecycle_event: lifecycleEvent } = process.env;

if (lifecycleEvent) {
if ((argv.length === 0 || argv[0].startsWith('--')) && lifecycleEvent) {
argv.splice(0, 0, lifecycleEvent);
}

Expand Down
2 changes: 2 additions & 0 deletions lib/commands/build-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,7 @@ module.exports = {
const output = await jsdocToMd.render(cfg);
await writeFile(readmePath, output, 'utf8');
await $`git add ./README.md`;
const cli = path.relative(process.cwd(), path.resolve(__dirname, '../../bin/cli.js'));
await $`${cli} prettier`;
}
};
2 changes: 1 addition & 1 deletion lib/commands/build-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
if (process.argv[2] === command) {
process.argv.splice(2, 1);
}
$.verbose = false;
$.verbose = true;
const cli = path.relative(process.cwd(), path.resolve(__dirname, '../../bin/cli.js'));
await $`${cli} clean-types`;
process.argv.push('--emitDeclarationOnly');
Expand Down

0 comments on commit f25f542

Please sign in to comment.