Skip to content

Instantly share code, notes, and snippets.

@fhferreira
Forked from vedovelli/gulpfile.js
Last active August 29, 2015 14:22
Show Gist options
  • Save fhferreira/23cdc15690c391f50462 to your computer and use it in GitHub Desktop.
Save fhferreira/23cdc15690c391f50462 to your computer and use it in GitHub Desktop.
/**
* gulpfile para automatizar a compilação feita com o Duo.js.
* Author: Fabio Vedovelli <[email protected]>
* http://vedovelli.com.br/
* Inspirado em https://github.com/mozilla/galaxy.js/blob/master/gulpfile.js
*/
var gulp = require('gulp');
/**
* Vai rodar o dup <nome arquivo>.js como se fosse no Terminal
*/
var exec = require('child_process').exec;
/**
* Arquivo a ser observado. -- Mude para a localização do seu arquivo --
*/
var jsFile = './src/home.js';
/**
* Basta no seu terminal rodar `gulp` (sem os apóstrofes, claaaaro)
*/
gulp.task('default', ['run_duo', 'watch']);
/**
* Responsável por rodar `dup <nome arquivo>.js`
*/
gulp.task('run_duo', function()
{
exec('duo ' + jsFile, function (err, stdout, stderr)
{
console.log(err);
console.log(stdout);
console.log(stderr);
});
});
gulp.task('watch', function()
{
/**
* Quando o arquivo for modificado, rodar task run_duo
*/
gulp.watch(jsFile, ['run_duo']);
});
@fhferreira
Copy link
Author

Pra manter de historico

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment