Skip to content

Commit

Permalink
Add a "watch" Jake task so you don't have to manually rebuild each time.
Browse files Browse the repository at this point in the history
  • Loading branch information
OscarGodson committed Jun 7, 2013
1 parent 56d6281 commit 326539a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
18 changes: 16 additions & 2 deletions Jakefile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var fs = require('fs')
, VERSION = fs.readFileSync('VERSION', 'utf-8')
, watch = require('node-watch')
, VERSION = fs.readFileSync('VERSION', 'utf-8');

function concat(fileList, destPath) {
var out = fileList.map(function (filePath) {
Expand Down Expand Up @@ -165,7 +166,20 @@ var pkg = new jake.PackageTask('EpicEditor', 'v' + VERSION, function () {
this.packageDir = "docs/downloads"
this.packageFiles.include(fileList)
this.needZip = true
})
});

desc('Watch for changes and automatically build');
task('watch', function () {
console.log('================================================\n| Files are now being watched. ctrl+c to exit. |\n================================================');
jake.Task.build.execute();
jake.Task.docs.execute();
watch('src/', function () {
jake.Task.build.execute();
});
watch('README.md', function () {
jake.Task.docs.execute();
});
});

desc('Kick out some ascii')
task('ascii', [], function () {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"mocha": "1.3.2",
"expect.js": "0.1.2",
"mime": "1.2.7",
"marked": "0.2.7"
"marked": "0.2.7",
"node-watch": "0.3.x"
},
"keywords": [
"embeddable",
Expand Down

0 comments on commit 326539a

Please sign in to comment.