mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 15:47:18 +02:00
Update build script
This commit is contained in:
parent
8d559a53a8
commit
857c7ec0c3
28
build.ts
28
build.ts
@ -89,14 +89,13 @@ const build = async (target: BuildTarget, version: string, config: any={}) => {
|
|||||||
|
|
||||||
// Check with ESLint
|
// Check with ESLint
|
||||||
const eslint = new ESLint();
|
const eslint = new ESLint();
|
||||||
eslint.lintFiles([path]).then((results: any) => {
|
const results = await eslint.lintFiles([path]);
|
||||||
results[0].messages.forEach((msg: any) => {
|
results[0].messages.forEach((msg: any) => {
|
||||||
console.error(`${path}#${msg.line}: ${msg.message}`);
|
console.error(`${path}#${msg.line}: ${msg.message}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`---- [${target}] done in ${performance.now() - startTime} ms`);
|
console.log(`---- [${target}] done in ${performance.now() - startTime} ms`);
|
||||||
console.log(`---- [${target}] ${new Date()}`);
|
console.log(`---- [${target}] ${new Date()}`);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const buildTargets = [
|
const buildTargets = [
|
||||||
@ -123,9 +122,26 @@ if (!values['version']) {
|
|||||||
sys.exit(-1);
|
sys.exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Building: ', values['version']);
|
async function main() {
|
||||||
|
const config = {};
|
||||||
const config = {};
|
console.log('Building: ', values['version']);
|
||||||
for (const target of buildTargets) {
|
for (const target of buildTargets) {
|
||||||
await build(target, values['version']!!, config);
|
await build(target, values['version']!!, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('\n** Press Enter to build or Esc to exit');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onKeyPress(data: any) {
|
||||||
|
const keyCode = data[0];
|
||||||
|
if (keyCode === 13) { // Enter key
|
||||||
|
main();
|
||||||
|
} else if (keyCode === 27) { // Esc key
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
||||||
|
process.stdin.setRawMode(true);
|
||||||
|
process.stdin.resume();
|
||||||
|
process.stdin.on('data', onKeyPress);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user