use findFile() api

This commit is contained in:
masnn committed 2021-04-13 17:49:58 +00:00
1 parent 8a8e312ca4
commit 9a538130ee
10 files changed
+105 -52

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ if (!cluster.isMaster) {
fs.ensureDirSync(path.resolve(os.homedir(), '.hydro'));
const addonPath = path.resolve(os.homedir(), '.hydro', 'addon.json');
let addons = filter(
fs.readdirSync(path.resolve(__dirname, '../packages')),
fs.readdirSync(path.resolve(process.cwd(), 'packages')),
(i) => i !== 'hydrooj',
).map((i) => `@hydrooj/${i}`);
fs.writeFileSync(addonPath, JSON.stringify(addons, null, 2));
+1 -2
View File
@@ -1,10 +1,9 @@
/* eslint-disable no-console */
/* eslint-disable import/no-extraneous-dependencies */
import path from 'path';
import globby from 'globby';
import spawn from 'cross-spawn';
export const cwd = path.resolve(__dirname, '..');
export const cwd = process.cwd();
export function getWorkspaces() {
return globby(require('../package').workspaces, {