Skip to content

Commit

Permalink
Simplifying version script; no need for async
Browse files Browse the repository at this point in the history
Not sure why the deploy step is failiing, but it appears to be using
an old version and trying to publish
  • Loading branch information
bbyars committed Oct 16, 2022
1 parent ad7e811 commit a34ca67
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions tasks/version.js
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');
}
});

0 comments on commit a34ca67

Please sign in to comment.