From bda843a33b8e9280df6c0720d18cb46c3eef6fcd Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Tue, 8 Oct 2024 16:46:13 -0500 Subject: [PATCH] revert read ignore call signature --- bids-validator/src/files/deno.ts | 9 +++++++-- bids-validator/src/files/ignore.ts | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/bids-validator/src/files/deno.ts b/bids-validator/src/files/deno.ts index 519d3460a..346d7f07f 100644 --- a/bids-validator/src/files/deno.ts +++ b/bids-validator/src/files/deno.ts @@ -148,10 +148,15 @@ async function _readFileTree( /** * Read in the target directory structure and return a FileTree */ -export function readFileTree(rootPath: string): Promise { +export async function readFileTree(rootPath: string): Promise { const ignore = new FileIgnoreRules([]) if (existsSync(join(rootPath, '.bidsignore'))) { - ignore.add(readBidsIgnore(join(rootPath, '.bidsignore'))) + const ignoreFile = new BIDSFileDeno( + rootPath, + '.bidsignore', + ignore, + ) + ignore.add(await readBidsIgnore(ignoreFile)) } return _readFileTree(rootPath, '/', ignore) } diff --git a/bids-validator/src/files/ignore.ts b/bids-validator/src/files/ignore.ts index d16e26010..6cb1cb358 100644 --- a/bids-validator/src/files/ignore.ts +++ b/bids-validator/src/files/ignore.ts @@ -2,8 +2,8 @@ import type { BIDSFile } from '../types/filetree.ts' import { default as ignore } from '@ignore' import type { Ignore } from '@ignore' -export function readBidsIgnore(file: string) { - const value = Deno.readTextFileSync(file) +export async function readBidsIgnore(file: BIDSFile) { + const value = await file.text() if (value) { const lines = value.split('\n') return lines