Skip to content

Commit

Permalink
revert read ignore call signature
Browse files Browse the repository at this point in the history
  • Loading branch information
rwblair committed Oct 8, 2024
1 parent 3ef60b7 commit bda843a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions bids-validator/src/files/deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,15 @@ async function _readFileTree(
/**
* Read in the target directory structure and return a FileTree
*/
export function readFileTree(rootPath: string): Promise<FileTree> {
export async function readFileTree(rootPath: string): Promise<FileTree> {
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)
}
4 changes: 2 additions & 2 deletions bids-validator/src/files/ignore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bda843a

Please sign in to comment.