Skip to content

Commit 906cba6

Browse files
authored
Apply NPM suggestions for bin (#168)
1 parent b83311d commit 906cba6

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"name": "flat",
33
"version": "6.0.0",
44
"type": "module",
5-
"bin": "cli.js",
5+
"bin": {
6+
"flat": "cli.js"
7+
},
68
"exports": {
79
".": {
810
"import": {

test/test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ suite('Order of Keys', function () {
612612

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

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

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

0 commit comments

Comments
 (0)