Allow recursive watching of folders

This commit is contained in:
Zoë Hoekstra 2022-08-25 18:56:24 +02:00
parent 75cf4b5d37
commit 363fa300c2
No known key found for this signature in database
GPG key ID: F9B7B7D8130F3323
2 changed files with 7 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "bitburner-filesync", "name": "bitburner-filesync",
"version": "1.0.0", "version": "1.0.2",
"description": "Official implementation of the Bitburner Filesync server", "description": "Official implementation of the Bitburner Filesync server",
"type": "module", "type": "module",
"bin": "./npx/bitburner-filesync.js", "bin": "./npx/bitburner-filesync.js",
@ -19,6 +19,7 @@
"remote" "remote"
], ],
"license": "Unlicense", "license": "Unlicense",
"author": "Zoë Hoekstra",
"bugs": { "bugs": {
"url": "https://github.com/bitburner-official/bitburner-filesync/issues" "url": "https://github.com/bitburner-official/bitburner-filesync/issues"
}, },

View file

@ -3,9 +3,12 @@ import {config} from "./config.js";
import {EventType} from "./eventTypes.js"; import {EventType} from "./eventTypes.js";
import {resolve } from "path"; import {resolve } from "path";
function fileFilter(event) { function fileFilter(file) {
if(config.get("allowedFiletypes").some(extension => event.path.endsWith(extension))) if(config.get("allowedFiletypes").some(extension => file.path.endsWith(extension)))
return true; return true;
if(file.stats.isDirectory())
return true;
return false;
} }
export async function setupWatch(signaller) { export async function setupWatch(signaller) {