mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-04-11 17:29:44 +00:00
fix: ensure safe removal of node_modules directory in build process
This commit is contained in:
parent
e719176b9c
commit
fd41247d37
@ -55,7 +55,10 @@ for (const p of fs.readdirSync(tmpDistTemplatesPath)) {
|
|||||||
// Replace local template with remote schema
|
// Replace local template with remote schema
|
||||||
patchManifestJsonSchema(pkgJsonPath)
|
patchManifestJsonSchema(pkgJsonPath)
|
||||||
// remove node_modules
|
// remove node_modules
|
||||||
fs.rmdirSync(path.join(distPath, "templates", p, "node_modules"), { recursive: true })
|
const nodeModulesPath = path.join(distPath, "templates", p, "node_modules")
|
||||||
|
if (fs.existsSync(nodeModulesPath)) {
|
||||||
|
fs.rmdirSync(nodeModulesPath, { recursive: true })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user