Skip to content

Commit

Permalink
Revert "web build did not like fs import at top of src/files/deno. Co…
Browse files Browse the repository at this point in the history
…nditionally load library. Maybe better off just attempting text call and seeing if it errors out."

This reverts commit c02e1f0.
  • Loading branch information
rwblair committed Oct 8, 2024
1 parent c02e1f0 commit 1960f96
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions bids-validator/src/files/deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Deno specific implementation for reading files
*/
import { basename, join } from '@std/path'
import { existsSync } from '@std/fs'
import * as posix from '@std/path/posix'
import { type BIDSFile, FileTree } from '../types/filetree.ts'
import { requestReadPermission } from '../setup/requestPermissions.ts'
Expand Down Expand Up @@ -149,16 +150,13 @@ async function _readFileTree(
*/
export async function readFileTree(rootPath: string): Promise<FileTree> {
const ignore = new FileIgnoreRules([])
if (globalThis.Deno) {
import { existsSync } from '@std/fs'
if (existsSync(join(rootPath, '.bidsignore'))) {
const ignoreFile = new BIDSFileDeno(
rootPath,
'.bidsignore',
ignore,
)
ignore.add(await readBidsIgnore(ignoreFile))
}
if (existsSync(join(rootPath, '.bidsignore'))) {
const ignoreFile = new BIDSFileDeno(
rootPath,
'.bidsignore',
ignore,
)
ignore.add(await readBidsIgnore(ignoreFile))
}
return _readFileTree(rootPath, '/', ignore)
}

0 comments on commit 1960f96

Please sign in to comment.