Consistenly use “Notfall-Codes” in de.xml
[GitHub/WoltLab/WCF.git] / extra / _buildAll.js
CommitLineData
5480a636
AE
1const childProcess = require("child_process");
2const fs = require("fs");
3
4if (process.argv.length !== 3) {
5 throw new Error("Requires the base path as argument.");
6}
7
8const basePath = process.argv[2];
9if (!basePath.match(/[\\\/]$/)) {
10 throw new Error("Path must end with a slash - any slash will do.");
11}
12else if (!fs.existsSync(basePath)) {
13 throw new Error(`Invalid path, '${basePath}' does not exist or is not readable.`);
14}
15
16fs.readdirSync(basePath)
17 .filter(directory => {
18 if (directory.indexOf('.') !== 0 && fs.statSync(basePath + directory).isDirectory()) {
19 // filter by known repository name patterns
20 if (directory === "WCF" || directory.indexOf("com.woltlab.") === 0) {
21 return true;
22 }
23 }
24
25 return false;
26 })
27 .forEach(directory => {
28 console.log(`##### Building ${directory} #####\n`);
29
30 let path = basePath + directory;
31 if (directory === "WCF") {
32 childProcess.execSync(`node _buildCore.js`, {
33 stdio: [0, 1, 2]
34 });
35 }
36 else {
37 childProcess.execSync(`node _buildExternal.js ${path}`, {
38 stdio: [0, 1, 2]
39 });
40 }
3f4a49f8
AE
41
42 childProcess.execSync(`ts-node syncTemplates.ts ${path}`, {
43 stdio: [0, 1, 2]
44 });
45
5480a636 46 console.log("\n");
3f4a49f8 47 });