watch contract files

This commit is contained in:
Iuri Matias 2016-09-22 22:18:28 -07:00
parent a1bedff7e1
commit 9e61009942
1 changed files with 18 additions and 2 deletions

View File

@ -18,17 +18,33 @@ Watch.prototype.start = function() {
// TODO: add callback to ready
this.logger.trace(filesToWatch);
var watcher = chokidar.watch(filesToWatch, {
var assetWatcher = chokidar.watch(filesToWatch, {
ignored: /[\/\\]\./,
persistent: true,
ignoreInitial: true,
followSymlinks: true
});
watcher
assetWatcher
.on('add', path => this.logger.info(`File ${path} has been added`))
.on('change', path => this.logger.info(`File ${path} has been changed`))
.on('unlink', path => this.logger.info(`File ${path} has been removed`))
.on('ready', () => this.logger.info('ready to watch changes'));
var contractsToWatch = [];
contractsToWatch.push(embarkConfig.contracts);
this.logger.trace(contractsToWatch);
var contractWatcher = chokidar.watch(contractsToWatch, {
ignored: /[\/\\]\./,
persistent: true,
ignoreInitial: true,
followSymlinks: true
});
contractWatcher
.on('add', path => this.logger.info(`File ${path} has been added`))
.on('change', path => this.logger.info(`File ${path} has been changed`))
.on('unlink', path => this.logger.info(`File ${path} has been removed`))
.on('ready', () => this.logger.info('ready to watch changes'));
this.logger.info("done!");
};