File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -917,9 +917,19 @@ export class CreatePullRequestViewProvider extends BaseCreatePullRequestViewProv
917917` ;
918918
919919 try {
920- // Create parent directories if they don't exist
921- const parentDir = vscode . Uri . joinPath ( templatePath , '..' ) ;
922- await vscode . workspace . fs . createDirectory ( parentDir ) ;
920+ // Ensure all parent directories exist by creating them step by step
921+ const pathParts = selected . label . split ( '/' ) ;
922+ let currentPath = workspaceFolder ;
923+
924+ // Create each directory in the path (excluding the file name)
925+ for ( let i = 0 ; i < pathParts . length - 1 ; i ++ ) {
926+ currentPath = vscode . Uri . joinPath ( currentPath , pathParts [ i ] ) ;
927+ try {
928+ await vscode . workspace . fs . createDirectory ( currentPath ) ;
929+ } catch ( e ) {
930+ // Directory might already exist, which is fine
931+ }
932+ }
923933
924934 // Create the template file
925935 const encoder = new TextEncoder ( ) ;
You can’t perform that action at this time.
0 commit comments