Hello yarn berry

This commit is contained in:
undefined committed 2021-05-26 23:35:36 +08:00
1 parent 04a4306895
commit 782f334a27
62 files changed
+448 -239

No files matched your search

+3 -3
View File
@@ -5,7 +5,7 @@ const path = require('path');
const cluster = require('cluster');
const fs = require('fs-extra');
const { filter } = require('lodash');
const { argv } = require('yargs');
const argv = require('cac')().parse();
const hydro = require('hydrooj');
if (!cluster.isMaster) {
@@ -24,7 +24,7 @@ if (!cluster.isMaster) {
fs.writeFileSync(addonPath, JSON.stringify(addons, null, 2));
try {
const ui = argv.ui || '@hydrooj/ui-default';
const ui = argv.options.ui || '@hydrooj/ui-default';
require.resolve(ui);
addons = [ui, ...addons];
} catch (e) {
@@ -33,7 +33,7 @@ if (!cluster.isMaster) {
addons = Array.from(new Set(addons));
for (const addon of addons) hydro.addon(addon);
(argv._[0] === 'cli' ? hydro.loadCli : hydro.load)().catch((e) => {
(argv.args[0] === 'cli' ? hydro.loadCli : hydro.load)().catch((e) => {
console.error(e);
process.exit(1);
});