File tree 1 file changed +4
-6
lines changed
packages/foam-vscode/src/services
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -205,12 +205,10 @@ export async function createMatcherAndDataStore(excludes: string[]): Promise<{
205
205
206
206
// Read .gitignore files and add patterns to excludePatterns
207
207
for ( const folder of workspace . workspaceFolders ) {
208
- const gitignorePath = path . join ( folder . uri . fsPath , '.gitignore' ) ;
208
+ const gitignoreUri = Uri . joinPath ( folder . uri , '.gitignore' ) ;
209
209
try {
210
- await workspace . fs . stat ( Uri . file ( gitignorePath ) ) ; // Check if the file exists
211
- const gitignoreContent = await workspace . fs . readFile (
212
- Uri . file ( gitignorePath )
213
- ) ; // Read the file content
210
+ await workspace . fs . stat ( gitignoreUri ) ; // Check if the file exists
211
+ const gitignoreContent = await workspace . fs . readFile ( gitignoreUri ) ; // Read the file content
214
212
const patterns = map (
215
213
filter (
216
214
split ( Buffer . from ( gitignoreContent ) . toString ( 'utf-8' ) , '\n' ) ,
@@ -220,7 +218,7 @@ export async function createMatcherAndDataStore(excludes: string[]): Promise<{
220
218
) ;
221
219
excludePatterns . get ( folder . name ) . push ( ...compact ( patterns ) ) ;
222
220
223
- Logger . info ( `Excluded patterns from ${ gitignorePath } : ${ patterns } ` ) ;
221
+ Logger . info ( `Excluded patterns from ${ gitignoreUri . path } : ${ patterns } ` ) ;
224
222
} catch ( error ) {
225
223
// .gitignore file does not exist, continue
226
224
Logger . error ( `Error reading .gitignore file: ${ error } ` ) ;
You can’t perform that action at this time.
0 commit comments