Skip to content

Commit

Permalink
change how Boxcutter is required from CLI to fix npx issue
Browse files Browse the repository at this point in the history
  • Loading branch information
andyburke committed May 31, 2018
1 parent 6af5529 commit 6f6f522
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions bin/boxcutter
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const util = require( 'util' );
const walk_up = util.promisify( require( 'walk-up' ) );
const yargs = require( 'yargs' );

const Boxcutter = require( path.resolve( path.join( __dirname, '..', 'index.js' ) ) );
const Boxcutter = require( '..' );

async function read_stdin() {
let buf = '';
Expand All @@ -26,19 +26,23 @@ async function read_stdin() {
yargs
.option( 'stdin', {
default: false,
description: 'read json from stdin vs. from a file or package.json'
description: 'read json from stdin vs. from a file or package.json',
global: true
} )
.option( 'file', {
default: 'package.json',
description: 'the file to search up the directory path for'
description: 'the file to search up the directory path for',
global: true
} )
.option( 'indent', {
default: 2,
description: 'indentation level for json output'
description: 'indentation level for json output',
global: true
} )
.option( 'save', {
default: false,
description: 'write changes back to input file'
description: 'write changes back to input file',
global: true
} )
.command( {
command: 'get <key>',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "boxcutter",
"version": "2.0.0",
"version": "2.0.2",
"description": "A utility knife for interacting with package.json (or other json files)",
"main": "index.js",
"bin": {
Expand Down

0 comments on commit 6f6f522

Please sign in to comment.