partey_workadventure/desktop/electron/helpers/set-version.js
Anbraten 03edc197d3
fix desktop app releasing (#2116)
* fix app releasing

* fix sed for macos

* fix setting app version on all oses
2022-04-25 10:18:13 +02:00

19 lines
451 B
JavaScript

const path = require('path');
const fs = require('fs');
let version = '0.0.0';
if (process.env.GITHUB_REF.startsWith('refs/tags/v')) {
version = process.env.GITHUB_REF.replace('refs/tags/v', '');
}
console.log('Version:', version);
const packageJsonPath = path.resolve(__dirname, '..', 'package.json');
let data = fs.readFileSync(packageJsonPath, 'utf8');
data = data.replace('managedbyci', version);
fs.writeFileSync(packageJsonPath, data);