mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +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() {
|
||||
|
||||
Reference in new issue
Block a user