Ignore dotfiles when checking
This commit is contained in:
parent
71403ceb0d
commit
7b3ea76a88
2
index.js
2
index.js
|
@ -183,6 +183,7 @@ const sendMessages = async (data) => {
|
||||||
|
|
||||||
|
|
||||||
fs.readdirSync(process.env.CONFIG_PATH).forEach(file => {
|
fs.readdirSync(process.env.CONFIG_PATH).forEach(file => {
|
||||||
|
if (file.startsWith(".")) return; // Ignore hidden files
|
||||||
contents = fs.readFileSync(path.join(process.env.CONFIG_PATH, file)).toString()
|
contents = fs.readFileSync(path.join(process.env.CONFIG_PATH, file)).toString()
|
||||||
switch (file) {
|
switch (file) {
|
||||||
case "IpBans.txt":
|
case "IpBans.txt":
|
||||||
|
@ -199,6 +200,7 @@ fs.readdirSync(process.env.CONFIG_PATH).forEach(file => {
|
||||||
|
|
||||||
const watchFiles = () => {
|
const watchFiles = () => {
|
||||||
fs.watch(process.env.CONFIG_PATH, (event, file) => {
|
fs.watch(process.env.CONFIG_PATH, (event, file) => {
|
||||||
|
if (file.startsWith(".")) return; // Ignore hidden files
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
tmp = {}
|
tmp = {}
|
||||||
newContents = fs.readFileSync(path.join(process.env.CONFIG_PATH, file)).toString()
|
newContents = fs.readFileSync(path.join(process.env.CONFIG_PATH, file)).toString()
|
||||||
|
|
Loading…
Reference in a new issue