Skip to content

Commit 9199aac

Browse files
committed
Module installer checker now respects --no-install
1 parent cb22173 commit 9199aac

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

index.js

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,23 @@ const installModules = async () => {
5050
};
5151

5252
installModules().then(() => {
53-
try {
54-
require.resolve("console-stamp");
55-
} catch (e) {
56-
if (require("fs").existsSync("node_modules")) {
57-
console.log(
58-
`\x1b[34m[Module Installer]`,
59-
`\x1b[37mModules installed, please restart the bot.`
60-
);
61-
process.exit(0);
62-
} else {
63-
console.log(
64-
`\x1b[34m[Module Installer]`,
65-
`\x1b[37mModules are not installed.`
66-
);
67-
process.exit(0);
53+
if (!process.argv.includes("--no-install")) {
54+
try {
55+
require.resolve("console-stamp");
56+
} catch (e) {
57+
if (require("fs").existsSync("node_modules")) {
58+
console.log(
59+
`\x1b[34m[Module Installer]`,
60+
`\x1b[37mModules installed, please restart the bot.`
61+
);
62+
process.exit(0);
63+
} else {
64+
console.log(
65+
`\x1b[34m[Module Installer]`,
66+
`\x1b[37mModules are not installed.`
67+
);
68+
process.exit(0);
69+
}
6870
}
6971
}
7072
require("console-stamp")(console, { format: ":date(HH:MM:ss).bold.grey" });
@@ -80,10 +82,10 @@ installModules().then(() => {
8082
module.exports["client"] = client;
8183
["config.yml", "commands.yml", "lang.yml"].forEach(
8284
(x) =>
83-
(module.exports[x.replace(".yml", "")] = YAML.parse(
84-
fs.readFileSync(x, "utf-8"),
85-
{ prettyErrors: true }
86-
))
85+
(module.exports[x.replace(".yml", "")] = YAML.parse(
86+
fs.readFileSync(x, "utf-8"),
87+
{ prettyErrors: true }
88+
))
8789
);
8890
["config", "lang", "commands"].forEach(
8991
(x) => (client[x] = module.exports[x])

0 commit comments

Comments
 (0)