File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -151,17 +151,14 @@ async function _readFileTree(
151151 */
152152export async function readFileTree ( rootPath : string ) : Promise < FileTree > {
153153 const ignore = new FileIgnoreRules ( [ ] )
154- try {
155- const ignoreFile = new BIDSFileDeno (
156- rootPath ,
157- '.bidsignore' ,
158- ignore ,
159- )
160- ignore . add ( await readBidsIgnore ( ignoreFile ) )
161- } catch ( err ) {
162- if ( err && typeof err === 'object' && ! ( 'code' in err && err . code === 'ENOENT' ) ) {
163- logger . error ( `Failed to read '.bidsignore' file with the following error:\n${ err } ` )
154+ const tree = await _readFileTree ( rootPath , '/' , ignore )
155+ const bidsignore = tree . get ( '.bidsignore' )
156+ if ( bidsignore ) {
157+ try {
158+ ignore . add ( await readBidsIgnore ( bidsignore as BIDSFile ) )
159+ } catch ( err ) {
160+ console . log ( `Failed to read '.bidsignore' file with the following error:\n${ err } ` )
164161 }
165162 }
166- return _readFileTree ( rootPath , '/' , ignore )
163+ return tree
167164}
You can’t perform that action at this time.
0 commit comments