File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/webview/create-component/pages Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,8 @@ export function FromLocalCodebase(props: FromLocalCodebaseProps) {
134134 window . vscodeApi . postMessage ( { action : 'getWorkspaceFolders' } ) ;
135135 if ( props . rootFolder && props . rootFolder . length != 0 ) {
136136 setProjectFolder ( props . rootFolder ) ;
137- const componentNameFromFolder : string = props . rootFolder . substring ( props . rootFolder . lastIndexOf ( '/' ) + 1 ) ;
137+ const isWindowsPath = props . rootFolder . charAt ( 1 ) === ':' ;
138+ const componentNameFromFolder : string = props . rootFolder . substring ( props . rootFolder . lastIndexOf ( isWindowsPath ? '\\' : '/' ) + 1 ) ;
138139 setComponentName ( componentNameFromFolder ) ;
139140 window . vscodeApi . postMessage ( {
140141 action : 'validateComponentName' ,
You can’t perform that action at this time.
0 commit comments