MCPcopy
hub / github.com/ionic-team/capacitor / deleteFolderRecursive

Function deleteFolderRecursive

cli/src/util/fs.ts:10–22  ·  view source on GitHub ↗
(directoryPath: any)

Source from the content-addressed store, hash-verified

8};
9
10export const deleteFolderRecursive = (directoryPath: any): void => {
11 if (existsSync(directoryPath)) {
12 readdirSync(directoryPath).forEach((file) => {
13 const curPath = join(directoryPath, file);
14 if (lstatSync(curPath).isDirectory()) {
15 deleteFolderRecursive(curPath);
16 } else {
17 unlinkSync(curPath);
18 }
19 });
20 rmdirSync(directoryPath);
21 }
22};
23
24export interface ReaddirPOptions {
25 /**

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected