watch for config file changes and redeploy
This commit is contained in:
parent
89c0001dcb
commit
df508e4e8d
19
lib/watch.js
19
lib/watch.js
|
@ -55,6 +55,25 @@ Watch.prototype.start = function() {
|
|||
.on('unlink', path => this.logger.info(`File ${path} has been removed`))
|
||||
.on('ready', () => this.logger.info('ready to watch changes'));
|
||||
|
||||
|
||||
var configWatcher = chokidar.watch("config/**/contracts.json", {
|
||||
ignored: /[\/\\]\./, persistent: true, ignoreInitial: true, followSymlinks: true
|
||||
});
|
||||
configWatcher
|
||||
.on('add', path => {
|
||||
this.logger.info(`File ${path} has been added`)
|
||||
this.trigger('redeploy', path);
|
||||
})
|
||||
.on('change', path => {
|
||||
this.logger.info(`File ${path} has been changed`)
|
||||
this.trigger('redeploy', path);
|
||||
})
|
||||
.on('unlink', path => {
|
||||
this.logger.info(`File ${path} has been removed`)
|
||||
this.trigger('redeploy', path);
|
||||
})
|
||||
.on('ready', () => this.logger.info('ready to watch changes'));
|
||||
|
||||
this.logger.info("done!");
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue