core: command: respect HYDRO_PROFILE

This commit is contained in:
undefined committed 2025-03-15 06:46:21 +08:00
1 parent a01c83c1b6
commit aa75195250
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -5,6 +5,7 @@ import readline from 'readline/promises';
import cac, { CAC } from 'cac';
import fs from 'fs-extra';
import { Logger, size } from '@hydrooj/utils';
import { hydroPath } from '../options';
const argv = cac().parse();
const logger = new Logger('db');
@@ -15,7 +16,6 @@ const exec = (...args: Parameters<typeof child.spawnSync>) => {
if (res.status) throw new Error(`Error: Exited with code ${res.status}`);
return res;
};
const hydroPath = path.resolve(os.homedir(), '.hydro');
const dir = `${os.tmpdir()}/${Math.random().toString(36).substring(2)}`;
function getUrl() {
const dbConfig = fs.readFileSync(path.resolve(hydroPath, 'config.json'), 'utf-8');
+1 -1
View File
@@ -8,6 +8,7 @@ import superagent from 'superagent';
import tar from 'tar';
import { extractZip, Logger } from '@hydrooj/utils';
import { version } from 'hydrooj/package.json';
import { hydroPath } from '../options';
const logger = new Logger('install');
let yarnVersion = 0;
@@ -18,7 +19,6 @@ try {
// yarn 2 does not support global dir
}
const hydroPath = path.resolve(os.homedir(), '.hydro');
const addonDir = path.join(hydroPath, 'addons');
function downloadAndExtractTgz(url: string, dest: string) {