From 84ae0b7791f23ad420398e2a72e41351092ad870 Mon Sep 17 00:00:00 2001 From: undefined Date: Thu, 17 Sep 2020 23:42:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E5=A4=84=E5=A5=87?= =?UTF-8?q?=E7=89=B9=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/build.js | 12 ++++++------ packages/hydrojudge/src/service.ts | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build/build.js b/build/build.js index eaad3fc25..0b2c44b3d 100644 --- a/build/build.js +++ b/build/build.js @@ -62,12 +62,12 @@ for (const package of packages) { fs.writeFileSync(path.resolve(process.cwd(), 'tsconfig.json'), JSON.stringify(config)); if (argv.watch) { - child.spawnSync('../node_modules/.bin/tsc -b --watch', { stdio: 'inherit' }); + child.execSync('./node_modules/.bin/tsc -b --watch', { stdio: 'inherit' }); } else { - let result = child.spawnSync('../node_modules/.bin/tsc -b', { stdio: 'inherit' }); - if (result.status != 0) { - result = child.spawnSync('../node_modules/.bin/tsc -b', { stdio: 'inherit' }); + let result; + try { + result = child.execSync('./node_modules/.bin/tsc -b', { stdio: 'inherit' }); + } catch (e) { + result = child.execSync('./node_modules/.bin/tsc -b', { stdio: 'inherit' }); } - console.log(result); - process.exit(result.status); } \ No newline at end of file diff --git a/packages/hydrojudge/src/service.ts b/packages/hydrojudge/src/service.ts index bb8a7fade..aa693ea58 100644 --- a/packages/hydrojudge/src/service.ts +++ b/packages/hydrojudge/src/service.ts @@ -1,6 +1,6 @@ // Hydro Integration /* eslint-disable no-await-in-loop */ -import { } from 'hydrooj'; +import 'hydrooj'; import path from 'path'; import cluster from 'cluster'; import child from 'child_process'; @@ -8,7 +8,7 @@ import { ObjectID } from 'bson'; import fs from 'fs-extra'; import { homedir, tmpdir } from 'os'; -declare module 'hydrooj' { +declare module 'hydrooj/dist/interface' { interface SystemKeys { 'hydrojudge.langs': string, }