mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 17:46:28 +08:00
core: command: respect HYDRO_PROFILE
This commit is contained in:
2 files changed
+2
-2
No files matched your search
@@ -5,6 +5,7 @@ import readline from 'readline/promises';
|
|||||||
import cac, { CAC } from 'cac';
|
import cac, { CAC } from 'cac';
|
||||||
import fs from 'fs-extra';
|
import fs from 'fs-extra';
|
||||||
import { Logger, size } from '@hydrooj/utils';
|
import { Logger, size } from '@hydrooj/utils';
|
||||||
|
import { hydroPath } from '../options';
|
||||||
const argv = cac().parse();
|
const argv = cac().parse();
|
||||||
|
|
||||||
const logger = new Logger('db');
|
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}`);
|
if (res.status) throw new Error(`Error: Exited with code ${res.status}`);
|
||||||
return res;
|
return res;
|
||||||
};
|
};
|
||||||
const hydroPath = path.resolve(os.homedir(), '.hydro');
|
|
||||||
const dir = `${os.tmpdir()}/${Math.random().toString(36).substring(2)}`;
|
const dir = `${os.tmpdir()}/${Math.random().toString(36).substring(2)}`;
|
||||||
function getUrl() {
|
function getUrl() {
|
||||||
const dbConfig = fs.readFileSync(path.resolve(hydroPath, 'config.json'), 'utf-8');
|
const dbConfig = fs.readFileSync(path.resolve(hydroPath, 'config.json'), 'utf-8');
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import superagent from 'superagent';
|
|||||||
import tar from 'tar';
|
import tar from 'tar';
|
||||||
import { extractZip, Logger } from '@hydrooj/utils';
|
import { extractZip, Logger } from '@hydrooj/utils';
|
||||||
import { version } from 'hydrooj/package.json';
|
import { version } from 'hydrooj/package.json';
|
||||||
|
import { hydroPath } from '../options';
|
||||||
|
|
||||||
const logger = new Logger('install');
|
const logger = new Logger('install');
|
||||||
let yarnVersion = 0;
|
let yarnVersion = 0;
|
||||||
@@ -18,7 +19,6 @@ try {
|
|||||||
// yarn 2 does not support global dir
|
// yarn 2 does not support global dir
|
||||||
}
|
}
|
||||||
|
|
||||||
const hydroPath = path.resolve(os.homedir(), '.hydro');
|
|
||||||
const addonDir = path.join(hydroPath, 'addons');
|
const addonDir = path.join(hydroPath, 'addons');
|
||||||
|
|
||||||
function downloadAndExtractTgz(url: string, dest: string) {
|
function downloadAndExtractTgz(url: string, dest: string) {
|
||||||
|
|||||||
Reference in new issue
Block a user