drawio-desktop/sync.cjs

17 lines
613 B
JavaScript
Raw Permalink Normal View History

2017-02-25 21:46:12 +03:00
const fs = require('fs')
const path = require('path')
2017-03-04 23:06:01 +03: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')
//Enable/disable updates
fs.writeFileSync(disableUpdatePath, 'export function disableUpdate() { return ' + (process.argv[2] == 'disableUpdate'? 'true' : 'false') + ';}', 'utf8');