Skip to content

Commit 0c4797f

Browse files
rwblaireffigies
andauthored
Update src/main.ts
Co-authored-by: Chris Markiewicz <markiewicz@stanford.edu>
1 parent be5b560 commit 0c4797f

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/main.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,9 @@ export async function main(): Promise<ValidationResult> {
3333
if (options.config) {
3434
config = JSON.parse(Deno.readTextFileSync(options.config))
3535
} else {
36-
const defaultConfig = join(absolutePath, '.bids-validator-config.json')
37-
try {
38-
await Deno.lstat(defaultConfig)
39-
config = JSON.parse(Deno.readTextFileSync(defaultConfig))
40-
options.config = defaultConfig
41-
} catch {
42-
if (!(err instanceof Deno.errors.NotFound)) {
43-
throw err;
44-
}
36+
const configFile = tree.get('.bids-validator-config.json') as BIDSFile
37+
if (configFile) {
38+
config = await configFile.text().then((text) => JSON.parse(text))
4539
}
4640
}
4741

0 commit comments

Comments
 (0)