mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-09-12 13:59:09 -05:00
This commit is contained in:
4
build
4
build
@@ -75,8 +75,6 @@ default:
|
||||
break;
|
||||
}
|
||||
|
||||
execSync(`node ./build-tools/update` + full, options);
|
||||
|
||||
if (full) {
|
||||
try {
|
||||
execSync(`node ./build-tools/build-commands`, options);
|
||||
@@ -84,3 +82,5 @@ if (full) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
execSync(`node ./build-tools/update` + full, options);
|
||||
|
||||
@@ -6,6 +6,8 @@ const child_process = require('node:child_process');
|
||||
|
||||
process.chdir(__dirname + '/..');
|
||||
|
||||
fs.mkdirSync('play.pokemonshowdown.com/data', { recursive: true });
|
||||
|
||||
const noUpdate = process.argv.includes('--no-update');
|
||||
if (!fs.existsSync('caches/pokemon-showdown')) {
|
||||
if (noUpdate) {
|
||||
|
||||
@@ -182,7 +182,7 @@ function compileToDir(srcDir, destDir, opts = {}) {
|
||||
return total;
|
||||
}
|
||||
|
||||
function compileToFile(srcFile, destFile, opts) {
|
||||
async function compileToFile(srcFile, destFile, opts) {
|
||||
const incremental = opts.incremental;
|
||||
delete opts.incremental;
|
||||
|
||||
@@ -205,12 +205,11 @@ function compileToFile(srcFile, destFile, opts) {
|
||||
if (VERBOSE) console.log(src + " ->");
|
||||
}
|
||||
|
||||
combineResults(results, {
|
||||
const combined = await combineResults(results, {
|
||||
file: path.basename(destFile),
|
||||
sourceRoot: opts.sourceRoot,
|
||||
}, opts).then(combined => {
|
||||
outputFileSync(destFile, combined, opts);
|
||||
});
|
||||
}, opts);
|
||||
outputFileSync(destFile, combined, opts);
|
||||
|
||||
if (VERBOSE) console.log("-> " + destFile);
|
||||
if (incremental) opts.incremental = true; // incredibly dumb hack to preserve the option
|
||||
|
||||
@@ -6,14 +6,12 @@
|
||||
* It also updates news and the learnsets-g6.js file.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
import fs from 'node:fs';
|
||||
import crypto from 'node:crypto';
|
||||
import child_process from 'node:child_process';
|
||||
import * as compiler from './compiler.mjs';
|
||||
|
||||
const fs = require('node:fs');
|
||||
const crypto = require('node:crypto');
|
||||
const child_process = require('node:child_process');
|
||||
const compiler = require('./compiler.mjs');
|
||||
|
||||
process.chdir(__dirname + '/..');
|
||||
process.chdir(import.meta.dirname + '/..');
|
||||
|
||||
const AUTOCONFIG_START = '/*** Begin automatically generated configuration ***/';
|
||||
const AUTOCONFIG_END = '/*** End automatically generated configuration ***/';
|
||||
@@ -38,7 +36,7 @@ function readOptionalFile(filename) {
|
||||
|
||||
process.stdout.write("Updating version... ");
|
||||
|
||||
let version = require('../package.json').version;
|
||||
let version = JSON.parse(fs.readFileSync('package.json', UTF8)).version;
|
||||
try {
|
||||
let commit = child_process.execSync('git rev-parse HEAD', {
|
||||
stdio: ['ignore', 'pipe', 'ignore'],
|
||||
@@ -130,7 +128,7 @@ compiledFiles += compiler.compileToDir(`teams.pokemonshowdown.com/src`, `teams.p
|
||||
try {
|
||||
fs.statSync('play.pokemonshowdown.com/data/text/en.js');
|
||||
// English text exists, we can compile battledata
|
||||
compiledFiles += compiler.compileToFile(
|
||||
compiledFiles += await compiler.compileToFile(
|
||||
[
|
||||
'play.pokemonshowdown.com/src/battle-dex.ts',
|
||||
'play.pokemonshowdown.com/src/battle-teams.ts',
|
||||
@@ -147,7 +145,7 @@ try {
|
||||
} catch {}
|
||||
|
||||
if (!compileOpts.ignore) {
|
||||
compiledFiles += compiler.compileToFile(
|
||||
compiledFiles += await compiler.compileToFile(
|
||||
['play.pokemonshowdown.com/src/battle-animations.ts', 'play.pokemonshowdown.com/src/battle-animations-moves.ts'],
|
||||
'play.pokemonshowdown.com/data/graphics.js',
|
||||
compileOpts
|
||||
|
||||
Reference in New Issue
Block a user