From 363fa300c21cca24eb1cb07ffa39904e3e1dbf5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Hoekstra?= Date: Thu, 25 Aug 2022 18:56:24 +0200 Subject: [PATCH] Allow recursive watching of folders --- package.json | 3 ++- src/fileWatch.js | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index cb06b98..f64774a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bitburner-filesync", - "version": "1.0.0", + "version": "1.0.2", "description": "Official implementation of the Bitburner Filesync server", "type": "module", "bin": "./npx/bitburner-filesync.js", @@ -19,6 +19,7 @@ "remote" ], "license": "Unlicense", + "author": "Zoƫ Hoekstra", "bugs": { "url": "https://github.com/bitburner-official/bitburner-filesync/issues" }, diff --git a/src/fileWatch.js b/src/fileWatch.js index 31abd3c..c5ad623 100644 --- a/src/fileWatch.js +++ b/src/fileWatch.js @@ -3,9 +3,12 @@ import {config} from "./config.js"; import {EventType} from "./eventTypes.js"; import {resolve } from "path"; -function fileFilter(event) { - if(config.get("allowedFiletypes").some(extension => event.path.endsWith(extension))) +function fileFilter(file) { + if(config.get("allowedFiletypes").some(extension => file.path.endsWith(extension))) return true; + if(file.stats.isDirectory()) + return true; + return false; } export async function setupWatch(signaller) {