diff --git a/lib/watch.js b/lib/watch.js index f8b6dbd4..e53864e9 100644 --- a/lib/watch.js +++ b/lib/watch.js @@ -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!"); };