Skip to content

Commit

Permalink
Fix bin
Browse files Browse the repository at this point in the history
  • Loading branch information
Methuselah96 committed Dec 7, 2023
1 parent 169dd7a commit fc7cfae
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
19 changes: 0 additions & 19 deletions packages/jsondiffpatch/bin/jsondiffpatch

This file was deleted.

18 changes: 18 additions & 0 deletions packages/jsondiffpatch/bin/jsondiffpatch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env node

import { readFileSync } from 'node:fs';
import * as jsondiffpatch from '../lib/with-text-diffs.js';
import * as consoleFormatter from '../lib/formatters/console.js';

const fileLeft = process.argv[2];
const fileRight = process.argv[3];

if (!fileLeft || !fileRight) {
console.log('\n USAGE: jsondiffpatch left.json right.json');
} else {
const left = JSON.parse(readFileSync(fileLeft));
const right = JSON.parse(readFileSync(fileRight));

const delta = jsondiffpatch.diff(left, right);
consoleFormatter.log(delta);
}
2 changes: 1 addition & 1 deletion packages/jsondiffpatch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"lib"
],
"bin": {
"jsondiffpatch": "./bin/jsondiffpatch"
"jsondiffpatch": "./bin/jsondiffpatch.js"
},
"scripts": {
"build": "tsc && ncp ./src/formatters/styles/ ./lib/formatters/styles/",
Expand Down

0 comments on commit fc7cfae

Please # to comment.