-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildWithStepSummary.ts
More file actions
56 lines (36 loc) · 1.44 KB
/
Copy pathbuildWithStepSummary.ts
File metadata and controls
56 lines (36 loc) · 1.44 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { execa } from "execa";
import { spawnStepSummaryWorker } from "./src/utils/stepSummary/spawnWorker";
import Log from 'next/dist/build/output/log';
const closeStepSummaryWorker = await spawnStepSummaryWorker();
if (process.env.NODE_ENV === 'production') {
process.env.DEBUG = '*';
process.env.DEBUG_HIDE_DATE = 'true';
process.env.DEBUG_DEPTH = '3';
process.env.DEBUG_SHOW_HIDDEN = 'true';
}
const $ = execa({stdio: ["inherit", "inherit", "inherit"]});
let hasError = true;
try {
Log.wait('[buildWithStepSummary.ts] Downloading any needed mods before starting the build...');
console.log('\n\n');
await $`pnpm run download-mods`;
console.log('\n\n');
Log.event('[buildWithStepSummary.ts] Needed mods are downloaded!');
console.log('\n\n');
Log.wait('[buildWithStepSummary.ts] Parsing Papyrus scripts before starting build...');
console.log('\n\n');
await $`pnpm run parse`;
console.log('\n\n');
Log.event('[buildWithStepSummary.ts] Parsed Papyrus scripts successfully!');
console.log('\n\n');
Log.wait('[buildWithStepSummary.ts] Starting build from script...');
console.log('\n\n');
await $`next build --webpack`;
console.log('\n\n');
Log.event('[buildWithStepSummary.ts] Build finished successfully!');
hasError = false;
} finally {
console.log('\n\n');
if (hasError) Log.error('[buildWithStepSummary.ts] Build failed!');
closeStepSummaryWorker();
}