1
0
mirror of https://github.com/zumbiepig/MineXLauncher.git synced 2025-06-26 10:05:10 +00:00
This commit is contained in:
zumbiepig
2024-08-31 08:14:02 -07:00
parent 85322cfdf7
commit c6f14eea16
9 changed files with 30 additions and 18 deletions

View File

@@ -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();