This repository has been archived by the owner on Aug 17, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 137
/
installSubModules.js
54 lines (44 loc) · 1.55 KB
/
installSubModules.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
const child_process = require("child_process")
const fs = require("fs")
const path = require("path")
const MODULES_DIRNAME = path.join(__dirname, "modules")
fs.readdirSync(MODULES_DIRNAME, {withFileTypes: true})
.forEach(e => {
if(!e.isDirectory())return
const MODULE_DIRNAME = path.join(MODULES_DIRNAME, e.name)
if(!fs.existsSync(path.join(MODULE_DIRNAME, "package.json")))return
if(e.name === "discord_spellcheck")return
console.log(`Installing modules in ${e.name}.`)
child_process.spawn((process.platform === "win32" ? "npm.cmd" : "npm"), ["i"], {
cwd: MODULE_DIRNAME,
env: process.env,
stdio: "inherit"
}).on("error", (err) => {
console.error(err)
process.exit(1)
})
})
const MODULE_DIRNAME = path.join(__dirname, "modules", "discord_desktop_core", "core")
const BETTERDISCORD_DIRNAME = path.join(__dirname, "BetterDiscordApp")
const DISCORDJS_DIRNAME = path.join(__dirname, "BetterDiscordApp")
child_process.spawn((process.platform === "win32" ? "npm.cmd" : "npm"), ["i"], {
cwd: MODULE_DIRNAME,
env: process.env,
stdio: "inherit"
}).on("error", (err) => {
console.error(err)
process.exit(1)
})
child_process.spawn((process.platform === "win32" ? "npm.cmd" : "npm"), ["i"], {
cwd: BETTERDISCORD_DIRNAME,
env: process.env,
stdio: "inherit"
}).on("error", (err) => {
console.error(err)
process.exit(1)
})
child_process.spawn((process.platform === "win32" ? "npm.cmd" : "npm"), ["i"], {
cwd: DISCORDJS_DIRNAME,
env: process.env,
stdio: "inherit"
})