mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ci fix
This commit is contained in:
5 files changed
+17
-17
No files matched your search
@@ -35,22 +35,22 @@ const newPath = path.resolve(os.homedir(), '.hydro', 'judge.yaml');
|
||||
const config = global.Hydro
|
||||
? JudgeSettings({})
|
||||
: (() => {
|
||||
const cfg = JudgeSettings({});
|
||||
const base: any = {};
|
||||
if (process.env.TEMP_DIR || argv.options.tmp) {
|
||||
base.tmp_dir = path.resolve(process.env.TEMP_DIR || argv.options.tmp);
|
||||
}
|
||||
if (process.env.CACHE_DIR || argv.options.cache) {
|
||||
base.cache_dir = path.resolve(process.env.CACHE_DIR || argv.options.cache);
|
||||
}
|
||||
if (process.env.EXECUTION_HOST || argv.options.sandbox) {
|
||||
base.sandbox_host = path.resolve(process.env.EXECUTION_HOST || argv.options.sandbox);
|
||||
}
|
||||
const configFilePath = (process.env.CONFIG_FILE || argv.options.config)
|
||||
? path.resolve(process.env.CONFIG_FILE || argv.options.config)
|
||||
: fs.existsSync(oldPath) ? oldPath : newPath;
|
||||
|
||||
if (process.env.TEMP_DIR || argv.options.tmp) {
|
||||
cfg.tmp_dir = path.resolve(process.env.TEMP_DIR || argv.options.tmp);
|
||||
}
|
||||
if (process.env.CACHE_DIR || argv.options.cache) {
|
||||
cfg.cache_dir = path.resolve(process.env.CACHE_DIR || argv.options.cache);
|
||||
}
|
||||
if (process.env.EXECUTION_HOST || argv.options.sandbox) {
|
||||
cfg.sandbox_host = path.resolve(process.env.EXECUTION_HOST || argv.options.sandbox);
|
||||
}
|
||||
const configFile = fs.readFileSync(configFilePath, 'utf-8');
|
||||
Object.assign(cfg, yaml.load(configFile) as any);
|
||||
Object.assign(base, yaml.load(configFile) as any);
|
||||
const cfg = JudgeSettings(base);
|
||||
return JudgeSettings(cfg);
|
||||
})();
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ export default class Hydro {
|
||||
uname: this.config.uname, password: this.config.password, rememberme: 'on',
|
||||
});
|
||||
const setCookie = res.headers['set-cookie'];
|
||||
await this.setCookie((setCookie instanceof Array) ? setCookie.join(';') : setCookie);
|
||||
await this.setCookie(Array.isArray(setCookie) ? setCookie.join(';') : setCookie);
|
||||
}
|
||||
|
||||
async ensureLogin() {
|
||||
|
||||
@@ -46,7 +46,7 @@ function _descriptor(v: ParamOption<any>) {
|
||||
obj.value = function validate(this: Handler, rawArgs: any, ...extra: any[]) {
|
||||
if (typeof rawArgs !== 'object' || extra.length) return originalMethod.call(this, rawArgs, ...extra);
|
||||
const c = [];
|
||||
const arglist: ParamOption<any>[] = this.__param[target.constructor.name][funcName];
|
||||
const arglist: ParamOption<any>[] = target.__param[target.constructor.name][funcName];
|
||||
for (const item of arglist) {
|
||||
const src = item.source === 'all'
|
||||
? rawArgs
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable global-require */
|
||||
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
|
||||
import CopyWebpackPlugin from 'copy-webpack-plugin';
|
||||
import { ESBuildMinifyPlugin } from 'esbuild-loader';
|
||||
import { EsbuildPlugin } from 'esbuild-loader';
|
||||
import { DuplicatesPlugin } from 'inspectpack/plugin';
|
||||
import ExtractCssPlugin from 'mini-css-extract-plugin';
|
||||
import MonacoWebpackPlugin from 'monaco-editor-webpack-plugin';
|
||||
@@ -214,7 +214,7 @@ export default function (env: { watch?: boolean, production?: boolean, measure?:
|
||||
},
|
||||
},
|
||||
usedExports: true,
|
||||
minimizer: [new ESBuildMinifyPlugin({
|
||||
minimizer: [new EsbuildPlugin({
|
||||
css: true,
|
||||
minify: true,
|
||||
minifySyntax: true,
|
||||
|
||||
@@ -2,7 +2,7 @@ import ReconnectingWebSocket from 'reconnecting-websocket';
|
||||
|
||||
export default class Sock {
|
||||
sock: ReconnectingWebSocket;
|
||||
interval: number;
|
||||
interval: NodeJS.Timeout;
|
||||
|
||||
constructor(public url: string, nocookie = false) {
|
||||
const i = new URL(url, window.location.href);
|
||||
|
||||
Reference in new issue
Block a user