mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
install: auto migration for uoj
This commit is contained in:
1 file changed
+2
-3
+2
-3
@@ -85,6 +85,8 @@ const addons = ['@hydrooj/ui-default', '@hydrooj/hydrojudge', '@hydrooj/fps-impo
|
|||||||
const installTarget = installAsJudge ? '@hydrooj/hydrojudge' : `hydrooj ${addons.join(' ')}`;
|
const installTarget = installAsJudge ? '@hydrooj/hydrojudge' : `hydrooj ${addons.join(' ')}`;
|
||||||
const substitutersArg = process.argv.find((i) => i.startsWith('--substituters='));
|
const substitutersArg = process.argv.find((i) => i.startsWith('--substituters='));
|
||||||
const substituters = substitutersArg ? substitutersArg.split('=')[1].split(',') : [];
|
const substituters = substitutersArg ? substitutersArg.split('=')[1].split(',') : [];
|
||||||
|
const migrationArg = process.argv.find((i) => i.startsWith('--migration='));
|
||||||
|
let migration = migrationArg ? migrationArg.split('=')[1] : '';
|
||||||
|
|
||||||
let locale = (process.env.LANG?.includes('zh') || process.env.LOCALE?.includes('zh')) ? 'zh' : 'en';
|
let locale = (process.env.LANG?.includes('zh') || process.env.LOCALE?.includes('zh')) ? 'zh' : 'en';
|
||||||
if (process.env.TERM === 'linux') locale = 'en';
|
if (process.env.TERM === 'linux') locale = 'en';
|
||||||
@@ -115,7 +117,6 @@ if (!cpuInfoFile.includes('avx2') && !installAsJudge) {
|
|||||||
avx2 = false;
|
avx2 = false;
|
||||||
log.warn('warn.avx2');
|
log.warn('warn.avx2');
|
||||||
}
|
}
|
||||||
let migration = '';
|
|
||||||
let retry = 0;
|
let retry = 0;
|
||||||
log.info('install.start');
|
log.info('install.start');
|
||||||
const defaultDict = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
|
const defaultDict = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
|
||||||
@@ -333,8 +334,6 @@ ${nixConfBase}`);
|
|||||||
.map((i) => i.trim()).filter((i) => i).map((i) => JSON.parse(i));
|
.map((i) => i.trim()).filter((i) => i).map((i) => JSON.parse(i));
|
||||||
const uoj = containers?.find((i) => i.Image.toLowerCase === 'universaloj/uoj-system' && i.State === 'running');
|
const uoj = containers?.find((i) => i.Image.toLowerCase === 'universaloj/uoj-system' && i.State === 'running');
|
||||||
if (uoj) {
|
if (uoj) {
|
||||||
// not ready for production
|
|
||||||
return;
|
|
||||||
log.info('migrate.uojFound');
|
log.info('migrate.uojFound');
|
||||||
const res = await rl.question('>');
|
const res = await rl.question('>');
|
||||||
if (res.toLowerCase().trim() === 'y') migration = 'uoj';
|
if (res.toLowerCase().trim() === 'y') migration = 'uoj';
|
||||||
|
|||||||
Reference in new issue
Block a user