-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepackage.js
35 lines (26 loc) · 1013 Bytes
/
prepackage.js
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
32
33
34
35
const fs = require("fs-extra");
const consolizerBinExists = fs.pathExistsSync(
"PSP-Bluetooth-Controller.ino.bin"
),
bluepadBinExists = fs.pathExistsSync("bluepad32-nina.bin");
const config = fs.readFileSync("config.json").toString();
const configVersionSet = !config.includes("<changeme>"),
commitShaSet = !config.includes("<commitsha>"),
commitMessageSet = !config.includes("<commitmessage>");
if (!consolizerBinExists)
console.error(
"\nPSP Consolizer binary (PSP-Bluetooth-Controller.ino.bin) does not exist\n"
);
if (!bluepadBinExists)
console.error("\nBluepad32 binary (bluepad32-nina.bin) does not exist\n");
if (!configVersionSet) console.error("\nBluepad32 version not set in config\n");
if (!commitShaSet) console.error("\nCommit SHA not set in config\n");
if (!commitMessageSet) console.error("\nCommit Message not set in config\n");
if (
!consolizerBinExists ||
!bluepadBinExists ||
!configVersionSet ||
!commitShaSet ||
!commitMessageSet
)
process.exit(1);