Skip to content

Commit

Permalink
Read the config right before changing files
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Mar 14, 2019
1 parent a44c8dc commit 6994447
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/set-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
});
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6994447

Please sign in to comment.