feat: 🚀 add and use dotenv-packed
Use dotenv for more convenient credential management
This commit is contained in:
parent
73d5f43ad3
commit
de0af4d2ac
12
lib/index.js
12
lib/index.js
|
@ -1,4 +1,4 @@
|
||||||
// TODO reload
|
const env = require("dotenv-packed").parseEnv().parsed
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
let cfg = {
|
let cfg = {
|
||||||
admin: "Applezaus",
|
admin: "Applezaus",
|
||||||
|
@ -12,14 +12,14 @@ const mineflayer = require("mineflayer");
|
||||||
const bot =
|
const bot =
|
||||||
!isNaN(parseInt(process.argv[3])) && parseInt(process.argv[3]) > 1e2 ?
|
!isNaN(parseInt(process.argv[3])) && parseInt(process.argv[3]) > 1e2 ?
|
||||||
mineflayer.createBot({
|
mineflayer.createBot({
|
||||||
host: process.argv[2] || process.env.MINECRAFT_HOST || 'localhost', // Change this to the ip you want.
|
host: process.argv[2] || process.env.MINECRAFT_HOST || env.MINECRAFT_HOST || 'localhost', // Change this to the ip you want.
|
||||||
port: parseInt(process.argv[3]) || process.env.MINECRAFT_PORT // || 58471,
|
port: parseInt(process.argv[3]) || process.env.MINECRAFT_PORT || env.MINECRAFT_PORT // || 58471,
|
||||||
})
|
})
|
||||||
:
|
:
|
||||||
mineflayer.createBot({
|
mineflayer.createBot({
|
||||||
host: process.argv[2] || process.env.MINECRAFT_HOST || 'localhost', // Change this to the ip you want.
|
host: process.argv[2] || process.env.MINECRAFT_HOST || env.MINECRAFT_HOST || 'localhost', // Change this to the ip you want.
|
||||||
username: process.argv[3] || process.env.MINECRAFT_USER,
|
username: process.argv[3] || process.env.MINECRAFT_USER || env.MINECRAFT_USER,
|
||||||
password: process.argv[4] || process.env.MINECRAFT_PASS,
|
password: process.argv[4] || process.env.MINECRAFT_PASS || env.MINECRAFT_PASS,
|
||||||
// port: process.argv[5] || process.env.MINECRAFT_PORT || 58471,
|
// port: process.argv[5] || process.env.MINECRAFT_PORT || 58471,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user