2017-02-25 21:46:12 +03:00
|
|
|
const fs = require('fs')
|
|
|
|
const path = require('path')
|
2017-03-04 23:06:01 +03:00
|
|
|
|
2022-09-01 13:45:23 +01:00
|
|
|
const appjsonpath = path.join(__dirname, 'package.json')
|
2023-06-16 12:54:47 -04:00
|
|
|
const disableUpdatePath = path.join(__dirname, 'src/main', 'disableUpdate.js')
|
2017-02-25 21:46:12 +03:00
|
|
|
|
2020-12-30 20:01:01 +00:00
|
|
|
let ver = fs.readFileSync(path.join(__dirname, 'drawio', 'VERSION'), 'utf8')
|
|
|
|
//let ver = '14.1.5' // just to test autoupdate
|
2017-02-25 21:46:12 +03:00
|
|
|
|
|
|
|
let pj = require(appjsonpath)
|
|
|
|
|
|
|
|
pj.version = ver
|
|
|
|
|
2017-05-28 20:56:47 +03:00
|
|
|
fs.writeFileSync(appjsonpath, JSON.stringify(pj, null, 2), 'utf8')
|
2021-02-23 19:41:06 -05:00
|
|
|
//Enable/disable updates
|
2024-05-17 17:34:22 -04:00
|
|
|
fs.writeFileSync(disableUpdatePath, 'export function disableUpdate() { return ' + (process.argv[2] == 'disableUpdate'? 'true' : 'false') + ';}', 'utf8');
|