From 6994447aeb2b9bfb1e23ddc417d613d45ef290f1 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Thu, 14 Mar 2019 11:30:34 -0300 Subject: [PATCH] Read the config right before changing files --- src/set-version.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/set-version.js b/src/set-version.js index 6da5cb0..27a712d 100644 --- a/src/set-version.js +++ b/src/set-version.js @@ -44,7 +44,6 @@ class Houston { throw new Error('Branch not synced or changes in files. Please run this only on clean stage.'); } - await this.readConfig(); await this.fetch(); await this.getRemote(); await this.selectAction(); @@ -62,8 +61,9 @@ class Houston { if (!file.houston) { return; } - if (file.updateFiles) { - file.updateFiles.forEach((file) => { + const { houston } = file; + if (houston.updateFiles) { + houston.updateFiles.forEach((file) => { files.push(file); }); } @@ -390,6 +390,8 @@ class Houston { } async updateVersionInFiles() { + await this.readConfig(); + await Promise.all(files.map(async(file) => { let data = await readFile(`./${ file }`, 'utf8'); data = data.replace(this.oldVersion, this.version);