cli: make package.json reading absolute
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
import program from 'commander';
|
||||
import chalk from 'chalk';
|
||||
import fs from 'fs';
|
||||
import { resolve as resolvePath } from 'path';
|
||||
import createAppCommand from './commands/create-app/createApp';
|
||||
import createPluginCommand from './commands/create-plugin/createPlugin';
|
||||
import watch from './commands/watch-deps';
|
||||
@@ -29,7 +30,9 @@ import pluginServe from './commands/plugin/serve';
|
||||
import { exitWithError } from './helpers/errors';
|
||||
|
||||
const main = (argv: string[]) => {
|
||||
const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf-8'));
|
||||
const packageJson = JSON.parse(
|
||||
fs.readFileSync(resolvePath(__dirname, '../package.json'), 'utf-8'),
|
||||
);
|
||||
|
||||
program.name('backstage-cli').version(packageJson.version ?? '0.0.0');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user