-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckdl.js
More file actions
31 lines (22 loc) · 809 Bytes
/
checkdl.js
File metadata and controls
31 lines (22 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const { spawn, spawnSync } = require('child_process');
const { join } = require('path');
const { platform } = require('os');
const { exit } = require('process');
let FILENAME = "./scryptc/win32/scryptc.exe"
if (platform() === 'linux') {
FILENAME = "./scryptc/linux/scryptc"
} else if (platform() === 'darwin') {
FILENAME = "./scryptc/mac/scryptc"
}
const output = spawnSync(join(__dirname, FILENAME), ['version']).stdout.toString();
const content = require("fs").readFileSync("./tag.json");
const version = JSON.parse(content).tag_name.toString().substr(1);
console.log('version', version, 'output', output)
if(version.indexOf("beta") > -1) {
console.warn('beta version skip check')
exit(0)
}
if(output.indexOf(version) < 0){
console.error('version check fail')
exit(-1)
}