mirror of
https://github.com/HirziDevs/PteroStats
synced 2026-01-07 14:05:46 +00:00
refactor: rename installer to setup
This commit is contained in:
@@ -34,7 +34,7 @@ PteroStats is a Discord App/Bot that designed to check Pterodactyl or Pelican Pa
|
||||
4. Run `npm install` in the root directory of the app/bot files.
|
||||
5. Run `node index` and answer the provided questions to set up the app/bot.
|
||||
|
||||
<img alt="Installer" src="https://usercontent.catto.pictures/hirzi/94742130-baaf-40b4-b046-06eb9c7fdb8c.png" width="300"/>
|
||||
<img alt="Setup" src="https://usercontent.catto.pictures/hirzi/94742130-baaf-40b4-b046-06eb9c7fdb8c.png" width="300"/>
|
||||
|
||||
- [Getting Panel API Key](#getting-panel-api-key)
|
||||
- [Getting a Channel ID](#getting-channel-id)
|
||||
@@ -44,7 +44,7 @@ PteroStats is a Discord App/Bot that designed to check Pterodactyl or Pelican Pa
|
||||
<img alt="Console Logging" src="https://usercontent.catto.pictures/hirzi/5fa377e2-d357-456e-aaf5-ae80e06b33ca.png" width="300"/>
|
||||
|
||||
### Changing Env Configuration
|
||||
1. Run `node config` in the root directory of the app/bot files.
|
||||
1. Run `node setup` in the root directory of the app/bot files.
|
||||
2. Enter `2` to change configuration.
|
||||
|
||||
<img alt="Change Configuration" src="https://usercontent.catto.pictures/hirzi/46105719-b87b-4ea4-a8af-36994ebea062.png" width="300"/>
|
||||
|
||||
@@ -26,7 +26,7 @@ const isValidURL = (url) => {
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = function Installer() {
|
||||
module.exports = function Setup() {
|
||||
console.log(cliColor.cyanBright("Welcome to PteroStats!"))
|
||||
console.log(cliColor.yellow("Please fill in the following credentials to set up the app.\n "));
|
||||
|
||||
@@ -81,12 +81,12 @@ module.exports = function Installer() {
|
||||
require("./app.js")()
|
||||
}).catch(() => {
|
||||
console.log(cliColor.redBright("❌ Invalid Channel ID."));
|
||||
console.log(" \n" + cliColor.redBright("Please run the installer again and fill in the correct credentials."));
|
||||
console.log(" \n" + cliColor.redBright("Please run the setup again and fill in the correct credentials."));
|
||||
process.exit()
|
||||
})
|
||||
}).catch(() => {
|
||||
console.log(cliColor.redBright("❌ Invalid Discord Bot Token."));
|
||||
console.log(" \n" + cliColor.redBright("Please run the installer again and fill in the correct credentials."));
|
||||
console.log(" \n" + cliColor.redBright("Please run the setup again and fill in the correct credentials."));
|
||||
process.exit()
|
||||
})
|
||||
}).catch((error) => {
|
||||
@@ -118,7 +118,7 @@ module.exports = function Installer() {
|
||||
} else {
|
||||
console.log(cliColor.cyanBright("[PteroStats] ") + cliColor.redBright(`Unexpected error: ${error.message}`));
|
||||
}
|
||||
console.log(" \n" + cliColor.redBright("Please run the installer again and fill in the correct credentials."));
|
||||
console.log(" \n" + cliColor.redBright("Please run the setup again and fill in the correct credentials."));
|
||||
process.exit()
|
||||
})
|
||||
}
|
||||
2
index.js
2
index.js
@@ -18,6 +18,6 @@ console.log(
|
||||
` \n \n${package.description}\n `
|
||||
);
|
||||
|
||||
if (!fs.existsSync(".env")) return require("./handlers/installer.js")();
|
||||
if (!fs.existsSync(".env")) return require("./handlers/setup.js")();
|
||||
|
||||
require("./handlers/app.js")();
|
||||
@@ -22,7 +22,7 @@ console.log(
|
||||
` \n \n${package.description}\n `
|
||||
);
|
||||
|
||||
if (!fs.existsSync(".env")) return require("./handlers/installer.js")();
|
||||
if (!fs.existsSync(".env")) return require("./handlers/setup.js")();
|
||||
|
||||
console.log(cliColor.yellowBright(
|
||||
"Configuration is already set. Please select one of the following options:\n \n" +
|
||||
@@ -35,7 +35,7 @@ readline.question('> ', async (answer) => {
|
||||
|
||||
switch(answer) {
|
||||
case '2':
|
||||
require('./handlers/installer.js')();
|
||||
require('./handlers/setup.js')();
|
||||
break;
|
||||
case '1':
|
||||
require('./handlers/app.js')();
|
||||
Reference in New Issue
Block a user