Skip to content

Commit

Permalink
Watch names
Browse files Browse the repository at this point in the history
  • Loading branch information
mde committed May 3, 2024
1 parent 9945258 commit dd8fbfe
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions jakefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,33 @@ if (typeof __dirname == 'undefined') {
}
`.trim();

task('build', ['lint', 'clean', 'compile', 'browserify', 'minify'], function () {
let _gotNewVersion = false;

jake.on('finished', function (ev) {

// Get updated version number -- do only once
if (!_gotNewVersion) {
_gotNewVersion = true;
let pkg = fs.readFileSync(path.join(process.cwd(), 'package.json'), 'utf-8');
pkg = JSON.parse(pkg);
console.log(pkg.version);
}

console.log('finished', ev.name);

if (ev.name === 'publish') {
console.log('Updating hosted docs...');
console.log('If this fails, run jake docPublish to re-try.');
jake.Task.docPublish.invoke();
}
else if (ev.name === '') {
}

});

desc('Builds the EJS library');
task('build', ['lint', 'clean', 'compile', 'browserify', 'minify']);

desc('Compiles ESM to CJS source files');
task('compile', function () {
// Compile CJS version
Expand Down Expand Up @@ -119,12 +143,3 @@ publishTask('ejs', ['build'], function () {
]);
});

jake.on('finished', function (ev) {
console.log('finished', ev.name);
});

jake.Task.publish.on('complete', function () {
console.log('Updating hosted docs...');
console.log('If this fails, run jake docPublish to re-try.');
jake.Task.docPublish.invoke();
});

0 comments on commit dd8fbfe

Please sign in to comment.