Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.

Commit

Permalink
fix: package.json path
Browse files Browse the repository at this point in the history
  • Loading branch information
ffflorian committed Jun 12, 2019
1 parent 9fcee28 commit 15f0558
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
#!/usr/bin/env node

import * as program from 'commander';
import * as fs from 'fs-extra';
import * as path from 'path';

import {FlatPublisher} from './FlatPublisher';

const getRemainingArgs = require('commander-remaining-args');
const defaultPackageJsonPath = path.join(__dirname, 'package.json');
const packageJsonPath = fs.existsSync(defaultPackageJsonPath)
? defaultPackageJsonPath
: path.join(__dirname, '../package.json');

const {bin, description, version} = require('../package.json');
const {bin, description, version} = fs.readJSONSync(packageJsonPath);

program
.name(Object.keys(bin)[0])
Expand Down

0 comments on commit 15f0558

Please sign in to comment.