forked from jgraph/drawio-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sync.js
23 lines (16 loc) · 841 Bytes
/
sync.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const fs = require('fs')
const path = require('path')
const child_process = require('child_process')
const electronAppDir = path.join(__dirname, 'drawio', 'src/main/webapp')
const appjsonpath = path.join(__dirname, 'drawio', 'src/main/webapp', 'package.json')
const disableUpdatePath = path.join(__dirname, 'drawio', 'src/main/webapp', 'disableUpdate.js')
let ver = fs.readFileSync(path.join(__dirname, 'drawio', 'VERSION'), 'utf8')
//let ver = '11.2.5' // just to test autoupdate
let pj = require(appjsonpath)
pj.version = ver
fs.writeFileSync(appjsonpath, JSON.stringify(pj, null, 2), 'utf8')
if (process.argv[2] == 'disableUpdate')
{
fs.writeFileSync(disableUpdatePath, 'module.exports = { disableUpdate: function() { return true;}}', 'utf8');
}
child_process.spawnSync('yarn', ['install', '--production'], {cwd: electronAppDir})