MCPcopy
hub / github.com/vitejs/vite / createNonEmptyDir

Function createNonEmptyDir

packages/create-vite/__tests__/cli.spec.ts:25–33  ·  view source on GitHub ↗
(overrideFolder?: string)

Source from the content-addressed store, hash-verified

23
24// Helper to create a non-empty directory
25const createNonEmptyDir = (overrideFolder?: string) => {
26 // Create the temporary directory
27 const newNonEmptyFolder = overrideFolder || genPath
28 fs.mkdirSync(newNonEmptyFolder, { recursive: true })
29
30 // Create a package.json file
31 const pkgJson = path.join(newNonEmptyFolder, 'package.json')
32 fs.writeFileSync(pkgJson, '{ "foo": "bar" }')
33}
34
35// Underscore-prefixed files are renamed to dot-prefixed on scaffold
36const fileNameMap: Record<string, string> = {

Callers 1

cli.spec.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected