forked from bbyars/mountebank
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplifying version script; no need for async
Not sure why the deploy step is failiing, but it appears to be using an old version and trying to publish
- Loading branch information
Showing
1 changed file
with
5 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,10 @@ | ||
'use strict'; | ||
|
||
const fs = require('fs'), | ||
const fs = require('fs-extra'), | ||
thisPackage = JSON.parse(fs.readFileSync('./package.json')), | ||
current = thisPackage.version; | ||
buildNumber = process.env.CIRCLE_BUILD_NUM; | ||
|
||
async function getVersion () { | ||
const buildNumber = process.env.CIRCLE_BUILD_NUM; | ||
|
||
if (typeof buildNumber === 'undefined') { | ||
// Leave as is if not in CI | ||
return current; | ||
} | ||
else { | ||
return `${current}-beta.${buildNumber}`; | ||
} | ||
if (typeof buildNumber !== 'undefined') { | ||
thisPackage.version = `${thisPackage.version}-beta.${buildNumber}`; | ||
fs.writeFileSync('./package.json', JSON.stringify(thisPackage, null, 2) + '\n'); | ||
} | ||
|
||
getVersion().then(next => { | ||
if (next !== current) { | ||
thisPackage.version = next; | ||
fs.writeFileSync('./package.json', JSON.stringify(thisPackage, null, 2) + '\n'); | ||
} | ||
}); |