watch contract files
This commit is contained in:
parent
a1bedff7e1
commit
9e61009942
20
lib/watch.js
20
lib/watch.js
|
@ -18,17 +18,33 @@ Watch.prototype.start = function() {
|
||||||
|
|
||||||
// TODO: add callback to ready
|
// TODO: add callback to ready
|
||||||
this.logger.trace(filesToWatch);
|
this.logger.trace(filesToWatch);
|
||||||
var watcher = chokidar.watch(filesToWatch, {
|
var assetWatcher = chokidar.watch(filesToWatch, {
|
||||||
ignored: /[\/\\]\./,
|
ignored: /[\/\\]\./,
|
||||||
persistent: true,
|
persistent: true,
|
||||||
ignoreInitial: true,
|
ignoreInitial: true,
|
||||||
followSymlinks: true
|
followSymlinks: true
|
||||||
});
|
});
|
||||||
watcher
|
assetWatcher
|
||||||
.on('add', path => this.logger.info(`File ${path} has been added`))
|
.on('add', path => this.logger.info(`File ${path} has been added`))
|
||||||
.on('change', path => this.logger.info(`File ${path} has been changed`))
|
.on('change', path => this.logger.info(`File ${path} has been changed`))
|
||||||
.on('unlink', path => this.logger.info(`File ${path} has been removed`))
|
.on('unlink', path => this.logger.info(`File ${path} has been removed`))
|
||||||
.on('ready', () => this.logger.info('ready to watch changes'));
|
.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!");
|
this.logger.info("done!");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue