-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate.js
More file actions
36 lines (31 loc) · 965 Bytes
/
generate.js
File metadata and controls
36 lines (31 loc) · 965 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { join } from "path";
import {
existsSync,
mkdirSync,
renameSync,
readFileSync,
writeFileSync,
} from "fs";
import fs from "fs-extra";
import { sync as deleteSync } from "rimraf";
const { copySync } = fs;
const count = 200;
if (existsSync("./src/app/subsystems")) {
deleteSync("./src/app/subsystems");
}
generate(count, "./src/app/subsystems/core/domain/components", 5);
generate(count, "./src/app/subsystems/core/data/components", 5);
generate(count, "./src/app/subsystems/billing/domain/components", 5);
generate(count, "./src/app/subsystems/billing/data/components", 5);
generate(count, "./src/app/subsystems/integration/slack/hooks/components", 6);
generate(
count,
"./src/app/subsystems/integration/paddle/infrastructure/services/api",
7,
);
function generate(amount, path, level) {
mkdirSync(path, { recursive: true });
for (let i = 1; i <= amount; i++) {
copySync("./src/app/module_0", join(path, `module_${i}`));
}
}