diff --git a/deno.json b/deno.json index 3533911..2edb6f1 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@andyburke/fsdb", - "version": "0.6.0", + "version": "0.6.1", "license": "MIT", "exports": { ".": "./fsdb.ts", diff --git a/fsdb.ts b/fsdb.ts index 5377926..2513bef 100644 --- a/fsdb.ts +++ b/fsdb.ts @@ -224,6 +224,14 @@ export class FSDB_COLLECTION> { let counter = 0; // TODO: better way to get a pattern to match files in this collection? + const root_stat = await Deno.lstat(this.config.root); + + if (!root_stat.isDirectory) { + console.warn(`missing root directory for fsdb collection:`); + console.dir(this.config); + return results; + } + for await ( const entry of fs.walk(this.config.root, { includeDirs: false,