Ignore dotfiles when checking

This commit is contained in:
Christopher Cookman 2024-07-22 12:30:54 -06:00
parent 71403ceb0d
commit 7b3ea76a88
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -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()