Skip to content

Commit

Permalink
fix(watch): Fix watch task
Browse files Browse the repository at this point in the history
  • Loading branch information
joaogarin committed Nov 8, 2016
1 parent f2cfd73 commit 6a5b803
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 15 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
<a name=""></a>
## Changelog (2016-11-08)


#### Features

* **build:** Added watch task ([f2cfd73b](https://github.com/epiqo/recruiter_epiq_deps/commit/f2cfd73baa30112c4cf2866a5d6da4fc14423306))
* **output:** Add colors to output messages ([5467439f](https://github.com/epiqo/recruiter_epiq_deps/commit/5467439fa4d35ed4dd6c7cdf119d38dcd177d203))

#### Bug Fixes

* **styleguide:** fix styleguide vars ([3539f0e8](https://github.com/epiqo/recruiter_epiq_deps/commit/3539f0e8e354c61ac64478a896c02b333fb49562))



<a name=""></a>
## Changelog (2016-10-13)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "recruiter_epiq_deps",
"version": "0.1.1",
"version": "0.1.2",
"description": "Dependencies for the epiq theme in Recruiter distro",
"main": "index.js",
"scripts": {
Expand Down
34 changes: 20 additions & 14 deletions scripts/watch.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
var exec = require('child_process').exec,
chalk = require('chalk'),
epiq_dir = '../../../../../../profiles/recruiter/themes/epiq';
var spawn = require('child_process').spawn,
chalk = require('chalk');

var cmd = 'cd node_modules/recruiter_epiq_deps && gulp watch --epiq_dir ' + epiq_dir;
var options = {cwd: 'node_modules/recruiter_epiq_deps'};

console.log('Running watch script - ' + chalk.yellow('gulp watch'));
exec(cmd, function (error, stdout, stderr) {
// command output is in stdout
if (!error) {
console.log(chalk.green(stdout));
}
else {
console.log(chalk.white(stdout));
console.log(chalk.red(error));
}
console.log(chalk.red(stderr));

var watch = spawn('gulp', options, ['watch']);

watch.stdout.on('data', function (data) {
console.log(chalk.green(data));
});

watch.stderr.on('data', function (data) {
console.log(chalk.red(data));
});

watch.on('close', function (data) {
console.log(chalk.white(data));
});

watch.on('error', function (err) {
console.log(chalk.red(err));
});

0 comments on commit 6a5b803

Please sign in to comment.