Skip to content

Commit

Permalink
🐛 rebuild command line argument does not work
Browse files Browse the repository at this point in the history
The reason is that we are using multiple commands in 'npm run build'.
So the actual command is:

npm run lint && node npm/build.js && npm run test "--rebuild"
  • Loading branch information
ggrossetie committed Jan 23, 2018
1 parent 2172991 commit e01df71
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions npm/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ Builder.prototype.build = function (callback) {

Builder.prototype.rebuild = function (callback) {
const target = 'build/asciidoctor-lib.js';
const args = process.argv.slice(2);
if (fs.existsSync(target) && !args.includes('--rebuild')) {
log.info(`${target} file already exists, skipping "rebuild" task.\nTIP: Use "npm run build -- --rebuild" to rebuild from Asciidoctor core.`);
if (fs.existsSync(target)) {
log.info(`${target} file already exists, skipping "rebuild" task.\nTIP: Use "npm run clean" to rebuild from Asciidoctor core.`);
callback();
return;
}
Expand Down

0 comments on commit e01df71

Please sign in to comment.