File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -636,15 +636,23 @@ export class Folders {
636636 }
637637 }
638638
639+ // For Windows, we need to make sure the drive letter is lowercased for consistency
640+ if ( isWindows ( ) ) {
641+ folders = folders . map ( ( folder ) => parseWinPath ( folder ) ) ;
642+ }
643+
639644 // Filter out the workspace folder
640645 if ( wsFolder ) {
641- folders = folders . filter ( ( folder ) => folder !== wsFolder . fsPath ) ;
646+ folders = folders . filter ( ( folder ) => folder !== parseWinPath ( wsFolder . fsPath ) ) ;
642647 }
643648
644649 const uniqueFolders = [ ...new Set ( folders ) ] ;
650+ const relativeFolderPaths = uniqueFolders . map ( ( folder ) =>
651+ relative ( parseWinPath ( wsFolder . fsPath ) , folder )
652+ ) ;
645653
646654 Logger . verbose ( 'Folders:getContentFolders:end' ) ;
647- return uniqueFolders . map ( ( folder ) => relative ( wsFolder ?. path || '' , folder ) ) ;
655+ return relativeFolderPaths ;
648656 }
649657
650658 /**
Original file line number Diff line number Diff line change 1+ import { isWindows } from '../utils' ;
2+
13export const parseWinPath = ( path : string | undefined ) : string => {
2- return path ?. split ( `\\` ) . join ( `/` ) || '' ;
4+ path = path ?. split ( `\\` ) . join ( `/` ) || '' ;
5+
6+ if ( isWindows ( ) ) {
7+ // Check if path starts with a drive letter (e.g., "C:\")
8+ if ( / ^ [ a - z A - Z ] : \\ / . test ( path ) ) {
9+ // Convert to lowercase drive letter
10+ path = path . charAt ( 0 ) . toLowerCase ( ) + path . slice ( 1 ) ;
11+ }
12+ }
13+
14+ return path ;
315} ;
You can’t perform that action at this time.
0 commit comments