Skip to content

Commit

Permalink
PCHR-4049: Fix watchers
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpavlov committed Aug 1, 2018
1 parent 01725f9 commit d37f669
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
17 changes: 9 additions & 8 deletions uk.co.compucorp.civicrm.hrcore/gulp/tasks/requirejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ module.exports = [
path.join(extPath, 'js/src/**/*.js')
], 'requirejs');

gulp.watch(watchPatterns, gulp.parallel('requirejs')).on('change', function (file) {
if (utils.canCurrentExtensionRun('test')) {
try {
test.for(file.path);
} catch (ex) {
test.all();
gulp.watch(watchPatterns, gulp.parallel('requirejs'))
.on('change', function (filePath) {
if (utils.canCurrentExtensionRun('test')) {
try {
test.for(filePath);
} catch (ex) {
test.all();
}
}
}
});
});
cb();
} else {
console.log('Not eligible for this task, skipping...');
Expand Down
4 changes: 2 additions & 2 deletions uk.co.compucorp.civicrm.hrcore/gulp/tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ module.exports = [
'!' + path.join(testFolderPath, 'test/test-main.js')
], 'test');

gulp.watch(watchPatterns).on('change', function (file) {
test.single(file.path);
gulp.watch(watchPatterns).on('change', function (filePath) {
test.single(filePath);
});
cb();
} else {
Expand Down

0 comments on commit d37f669

Please sign in to comment.