mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: use new config path by default
This commit is contained in:
1 parent
f80c3426fc
commit
489a374445
4 files changed
+71
-20
No files matched your search
@@ -29,13 +29,16 @@ const JudgeSettings = Schema.object({
|
||||
detail: Schema.boolean().description('Show diff detail').default(true),
|
||||
});
|
||||
|
||||
const oldPath = path.resolve(os.homedir(), '.config', 'hydro', 'judge.yaml');
|
||||
const newPath = path.resolve(os.homedir(), '.hydro', 'judge.yaml');
|
||||
|
||||
const config = global.Hydro
|
||||
? JudgeSettings({})
|
||||
: (() => {
|
||||
const cfg = JudgeSettings({});
|
||||
const configFilePath = (process.env.CONFIG_FILE || argv.options.config)
|
||||
? path.resolve(process.env.CONFIG_FILE || argv.options.config)
|
||||
: path.resolve(os.homedir(), '.config', 'hydro', 'judge.yaml');
|
||||
: 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);
|
||||
|
||||
Reference in new issue
Block a user