mirror of
https://github.com/zumbiepig/MineXLauncher.git
synced 2025-06-26 10:05:10 +00:00
fix?
This commit is contained in:
13
build.ts
13
build.ts
@@ -4,8 +4,8 @@ import { join } from 'path';
|
||||
import chalk from 'chalk';
|
||||
|
||||
function getFiles(baseDir: string, dir?: string, filesArr?: string[]) {
|
||||
dir = dir || baseDir;
|
||||
filesArr = filesArr || [];
|
||||
dir = dir ?? baseDir;
|
||||
filesArr = filesArr ?? [];
|
||||
const files = readdirSync(dir);
|
||||
for (const file of files) {
|
||||
const name = join(dir, file);
|
||||
@@ -18,6 +18,8 @@ function getFiles(baseDir: string, dir?: string, filesArr?: string[]) {
|
||||
return filesArr;
|
||||
}
|
||||
|
||||
console.clear();
|
||||
|
||||
console.log(chalk.cyan('Linting code...\n'));
|
||||
const lintOutput = await $`bunx eslint ./src/`.nothrow().text();
|
||||
if (lintOutput) {
|
||||
@@ -25,6 +27,13 @@ if (lintOutput) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log(chalk.cyan('Type-checking code...\n'));
|
||||
const tscOutput = await $`bunx tsc`.nothrow().text();
|
||||
if (tscOutput) {
|
||||
console.error(tscOutput);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log(chalk.cyan('Removing old build artifacts...\n'));
|
||||
await $`rm -rf ./public/resources/scripts/ ./public/assets.json ./public/sw.js ./public/sw-full.js`.quiet();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user