Files
Guangcong Luo daa28cfeb1
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
Preact minor updates batch 45
- Support new Team Preview choice protocol
- Fix contentEditable cursor reset on blur+refocus
  - (Unfocusing and focusing would reset the textbox cursor position)
- Fix horizontal movement having precedence over selection and sliders
  in mobile
  - (You couldn't modify selections or drag sliders because it would
    slide open the menu instead)
- Fix build error
  - (Replays no longer has a custom build path)
- Don't apply "Zoom out forms" setting to import/export tab
2026-08-15 08:29:35 +00:00

75 lines
1.6 KiB
JavaScript
Executable File

#!/usr/bin/env node
if (!require('assert').strict) {
console.error("We require Node.js version 10 or later; you're using " + process.version);
process.exit(1);
}
var execSync = require('child_process').execSync;
var fs = require('fs');
process.chdir(__dirname);
try {
require.resolve('@babel/core');
} catch (e) {
console.log('Installing dependencies...');
execSync('npm install', {stdio: 'inherit'});
}
try {
require.resolve('./config/config');
} catch (err) {
if (err.code !== 'MODULE_NOT_FOUND') throw err; // should never happen
console.log('config.js does not exist. Creating one with default settings...');
fs.writeFileSync(
'config/config.js',
fs.readFileSync('config/config-example.js')
);
}
var options = {cwd: __dirname, stdio: 'inherit'};
var full = '';
switch (process.argv[2] || '') {
case 'full':
execSync(`node ./build-tools/build-indexes`, options);
execSync(`node ./build-tools/build-learnsets`, options);
execSync(`node ./build-tools/build-minidex`, options);
full = ' full';
break;
case 'indexes':
execSync(`node ./build-tools/build-indexes`, options);
break;
case 'learnsets':
execSync(`node ./build-tools/build-learnsets`, options);
break;
case 'minidex':
case 'sprites':
execSync(`node ./build-tools/build-minidex`, options);
break;
case 'commands':
execSync(`node ./build-tools/build-commands`, options);
break;
case 'test-only':
break;
case '':
break;
default:
console.log(`Unrecognized command ${process.argv[2]}`);
process.exit();
break;
}
execSync(`node ./build-tools/update` + full, options);
if (full) {
try {
execSync(`node ./build-tools/build-commands`, options);
} catch (e) {
console.error(e);
}
}