Skip to content

Instantly share code, notes, and snippets.

@luqmaan
Last active July 12, 2017 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luqmaan/ea1e2edd2ab3661224b3c37609d6a41b to your computer and use it in GitHub Desktop.
Save luqmaan/ea1e2edd2ab3661224b3c37609d6a41b to your computer and use it in GitHub Desktop.
gulpTask = (name, fn) => {
done = (err) => {
if (err) {
console.log(`Completed task "${name}" with error`);
console.error(err)
}
else {
console.log(`Completed task "${name}" successfully`);
}
}
console.log(`Starting task "${name}"`)
fn(done);
}
gulpTask('add numbers', (cb) => {
try {
console.log(3 + 3)
cb()
}
catch (err) {
cb(err)
}
})
gulpTask('be dumb and use a number like a function', (cb) => {
try {
100()
cb()
}
catch (err) {
cb(err)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment