Skip to content

Commit 94ddeaf

Browse files
committed
fix(init): create .vscode directory if it doesn't exist
When setting up VS Code debugging, make sure that the `.vscode` directory exists before writing to `.vscode/launch.json`.
1 parent 1ef715c commit 94ddeaf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/project/initProjectWizard.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { cancel, confirm, intro, isCancel, log, note, outro, select, text } from '@clack/prompts';
22
import chalkTemplate from 'chalk-template';
3-
import { existsSync, writeFileSync } from 'fs';
3+
import { existsSync, writeFileSync, mkdirSync } from 'fs';
44
import path from 'path';
55
import { boards } from './boards.js';
66
import { createDiagram } from './createDiagram.js';
@@ -159,6 +159,8 @@ export async function initProjectWizard(rootDir: string, opts: { diagramFile?: s
159159
},
160160
],
161161
};
162+
163+
mkdirSync(path.dirname(launchJsonPath), { recursive: true });
162164
writeFileSync(launchJsonPath, JSON.stringify(vsCodeLaunchJson, null, 2));
163165
}
164166

0 commit comments

Comments
 (0)