From 2996f513146e0a442f3e2097c3fb4a341d9bbc4b Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Fri, 15 Jun 2018 15:50:23 -0400 Subject: [PATCH 1/2] fix watch for simple apps --- lib/pipeline/watch.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/pipeline/watch.js b/lib/pipeline/watch.js index e670f290..ca81ed37 100644 --- a/lib/pipeline/watch.js +++ b/lib/pipeline/watch.js @@ -99,12 +99,17 @@ class Watch { watchConfigs(embarkConfig, callback) { let self = this; - let configFolder = embarkConfig.config.replace(/\\/g, '/'); - if (configFolder.charAt(configFolder.length - 1) !== '/') { - configFolder += '/'; + let contractsConfig; + if (typeof embarkConfig.config === 'object' || embarkConfig.config.contracts) { + contractsConfig = embarkConfig.config.contracts; + } else { + let contractsFolder = embarkConfig.config.replace(/\\/g, '/'); + if (contractsFolder.charAt(contractsFolder.length - 1) !== '/') { + contractsFolder += '/'; + } + contractsConfig = [`${contractsFolder}**/contracts.json`, `${contractsFolder}**/contracts.js`] } - this.watchFiles( - [`${configFolder}**/contracts.json`, `${configFolder}**/contracts.js`], + this.watchFiles(contractsConfig, function (eventName, path) { self.logger.info(`${eventName}: ${path}`); self.events.emit('file-' + eventName, 'config', path); From e9becec5159d11b46df7be2e8eb1d1b453922032 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Fri, 15 Jun 2018 15:58:19 -0400 Subject: [PATCH 2/2] sorry senior lint --- lib/pipeline/watch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pipeline/watch.js b/lib/pipeline/watch.js index ca81ed37..6d028ddc 100644 --- a/lib/pipeline/watch.js +++ b/lib/pipeline/watch.js @@ -107,7 +107,7 @@ class Watch { if (contractsFolder.charAt(contractsFolder.length - 1) !== '/') { contractsFolder += '/'; } - contractsConfig = [`${contractsFolder}**/contracts.json`, `${contractsFolder}**/contracts.js`] + contractsConfig = [`${contractsFolder}**/contracts.json`, `${contractsFolder}**/contracts.js`]; } this.watchFiles(contractsConfig, function (eventName, path) {