rman 0.37.2 → 0.37.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +6 -3
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import colors from 'ansi-colors';
|
|
2
2
|
import { getDirname } from 'cross-dirname';
|
|
3
|
-
import fs from 'fs
|
|
3
|
+
import fs from 'fs';
|
|
4
4
|
import logger from 'npmlog';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import yargs from 'yargs';
|
|
@@ -17,8 +17,11 @@ import { Command } from './core/command.js';
|
|
|
17
17
|
import { Repository } from './core/repository.js';
|
|
18
18
|
export async function runCli(options) {
|
|
19
19
|
try {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
let s = path.resolve(getDirname(), './package.json');
|
|
21
|
+
if (!fs.existsSync(s)) {
|
|
22
|
+
s = path.resolve(getDirname(), '../package.json');
|
|
23
|
+
}
|
|
24
|
+
const pkgJson = JSON.parse(fs.readFileSync(s, 'utf-8'));
|
|
22
25
|
const repository = Repository.create(options?.cwd);
|
|
23
26
|
const _argv = options?.argv || process.argv.slice(2);
|
|
24
27
|
const globalKeys = Object.keys(Command.globalOptions).concat(['help', 'version']);
|