-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
32 lines (28 loc) · 890 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var agent = require('webkit-devtools-agent');
var grunt = require('grunt')
var gruntLastMsg = 0
grunt.log.overwrite = function (msg) {
if (Date.now() < gruntLastMsg + 2000) return grunt.log
gruntLastMsg = Date.now()
process.stdout.clearLine && process.stdout.clearLine()
return grunt.log.write.call(this, '\r' + (msg || ''))
}
// Wrapper to run a grunt task asynchronously
var runTask = function (task, done, taskArgs) {
try {
console.log('Task started: ' + task)
require('./tasks/' + task)
.call(
{
async:function () {
return function () {
console.log('\nTask finished: ' + task)
done()
}
}
}, grunt, taskArgs || [])
} catch (e) {
console.error(e)
}
}
runTask('courses/update')