Skip to content

Commit

Permalink
Apply NPM suggestions for bin (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkoops authored Sep 15, 2023
1 parent b83311d commit 906cba6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"name": "flat",
"version": "6.0.0",
"type": "module",
"bin": "cli.js",
"bin": {
"flat": "cli.js"
},
"exports": {
".": {
"import": {
Expand Down
6 changes: 3 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ suite('Order of Keys', function () {

suite('CLI', function () {
test('can take filename', function (done) {
const cli = path.resolve(__dirname, '..', pkg.bin)
const cli = path.resolve(__dirname, '..', pkg.bin.flat)
const pkgJSON = path.resolve(__dirname, '..', 'package.json')
exec(`${cli} ${pkgJSON}`, (err, stdout, stderr) => {
assert.ifError(err)
Expand All @@ -622,7 +622,7 @@ suite('CLI', function () {
})

test('exits with usage if no file', function (done) {
const cli = path.resolve(__dirname, '..', pkg.bin)
const cli = path.resolve(__dirname, '..', pkg.bin.flat)
const pkgJSON = path.resolve(__dirname, '..', 'package.json')
exec(`${cli} ${pkgJSON}`, (err, stdout, stderr) => {
assert.ifError(err)
Expand All @@ -632,7 +632,7 @@ suite('CLI', function () {
})

test('can take piped file', function (done) {
const cli = path.resolve(__dirname, '..', pkg.bin)
const cli = path.resolve(__dirname, '..', pkg.bin.flat)
const pkgJSON = path.resolve(__dirname, '..', 'package.json')
exec(`cat ${pkgJSON} | ${cli}`, (err, stdout, stderr) => {
assert.ifError(err)
Expand Down

0 comments on commit 906cba6

Please sign in to comment.