mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-10 12:46:29 +00:00
fix watch for simple apps
This commit is contained in:
parent
6ea395ca76
commit
2996f51314
@ -99,12 +99,17 @@ class Watch {
|
|||||||
|
|
||||||
watchConfigs(embarkConfig, callback) {
|
watchConfigs(embarkConfig, callback) {
|
||||||
let self = this;
|
let self = this;
|
||||||
let configFolder = embarkConfig.config.replace(/\\/g, '/');
|
let contractsConfig;
|
||||||
if (configFolder.charAt(configFolder.length - 1) !== '/') {
|
if (typeof embarkConfig.config === 'object' || embarkConfig.config.contracts) {
|
||||||
configFolder += '/';
|
contractsConfig = embarkConfig.config.contracts;
|
||||||
|
} else {
|
||||||
|
let contractsFolder = embarkConfig.config.replace(/\\/g, '/');
|
||||||
|
if (contractsFolder.charAt(contractsFolder.length - 1) !== '/') {
|
||||||
|
contractsFolder += '/';
|
||||||
}
|
}
|
||||||
this.watchFiles(
|
contractsConfig = [`${contractsFolder}**/contracts.json`, `${contractsFolder}**/contracts.js`]
|
||||||
[`${configFolder}**/contracts.json`, `${configFolder}**/contracts.js`],
|
}
|
||||||
|
this.watchFiles(contractsConfig,
|
||||||
function (eventName, path) {
|
function (eventName, path) {
|
||||||
self.logger.info(`${eventName}: ${path}`);
|
self.logger.info(`${eventName}: ${path}`);
|
||||||
self.events.emit('file-' + eventName, 'config', path);
|
self.events.emit('file-' + eventName, 'config', path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user