-
Notifications
You must be signed in to change notification settings - Fork 0
/
reset.js
55 lines (49 loc) · 1.3 KB
/
reset.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
55
#!/usr/bin/env node
const { getMessage } = require("./helpers");
const updateNotifier = require("update-notifier");
const packageJson = require("./package.json");
const Configstore = require("configstore");
const inquirer = require("inquirer");
require("colors");
const config = new Configstore(packageJson.name);
if (
!(
config.has("language") ||
config.has("authorName") ||
config.has("commandsFolder")
)
) {
console.log(
"Vous devez configurer ce paquet avant de l'utiliser. Exécutez ".red +
"config-cccmd".white
);
console.log(
"You must configure this package before using it. Execute ".red +
"config-cccmd".white
);
return;
}
console.log();
console.log(getMessage("welcomeReset").blue);
main();
async function main() {
const { confirm } = await inquirer.prompt([
{
type: "confirm",
name: "confirm",
message: getMessage("confirmConfigurationDeletion"),
default: false
}
]);
if (!confirm)
return console.log(getMessage("configurationDeletionAborted").red);
console.log(getMessage("configurationDeletionCompleted").green);
config.clear();
const notifier = updateNotifier({
pkg: packageJson,
updateCheckInterval: 1000 * 60 * 24
});
if (notifier.update) {
console.log(getMessage("updateAvailable").green.bold);
}
}