diff --git a/src/node-modules/create-folder.ts b/src/node-modules/create-folder.ts index 92a3574..48c1b16 100644 --- a/src/node-modules/create-folder.ts +++ b/src/node-modules/create-folder.ts @@ -47,8 +47,12 @@ export function createFolderSync( ...options, }; const target = resolve(cwd, targetPath); - const stats = statSync(target); - if (!stats) { + try { + const stats = statSync(target); + if (!stats) { + mkdirSync(target, { recursive: true }); + } + } catch { mkdirSync(target, { recursive: true }); } }