Allow recursive watching of folders
This commit is contained in:
parent
75cf4b5d37
commit
363fa300c2
2 changed files with 7 additions and 3 deletions
|
@ -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"
|
||||||
},
|
},
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue