From 53a872a11b5f204cdf3899120c1bf4a9a03a0ad7 Mon Sep 17 00:00:00 2001 From: RyanHx Date: Sun, 28 Aug 2022 15:12:36 +0100 Subject: [PATCH] Emit MessageSend for every file --- src/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/index.js b/src/index.js index 982a3e4..8d317a7 100644 --- a/src/index.js +++ b/src/index.js @@ -25,6 +25,14 @@ export async function start() { // Upload missing files to the game. signal.emit(EventType.MessageSend, requestFilenames()); + + if (config.get("pushOnCon")) { + const extensions = config.get("allowedFiletypes"); + for (const path of watch.paths.keys()) { + if (extensions.some(extension => path.endsWith(extension))) + signal.emit(EventType.MessageSend, fileChangeEventToMsg({ path: path })) + } + } }) // Add a handler for changed files.