Skip to content

Commit 139321e

Browse files
committed
make json-to-go.js directly executable
1 parent bfc29a7 commit 139321e

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ Contributions are welcome! Open a pull request to fix a bug, or open an issue to
1717
- Read JSON file:
1818

1919
```sh
20-
node json-to-go.js sample.json
20+
./json-to-go.js sample.json
2121
```
2222

2323
- Read JSON file from stdin:
2424

2525
```sh
26-
node json-to-go.js < sample.json
27-
cat sample.json | node json-to-go.js
26+
./json-to-go.js < sample.json
27+
cat sample.json | ./json-to-go.js
2828
```
2929

3030
- For more options, check the help page
3131

3232
```sh
33-
node json-to-go.js --help
33+
./json-to-go.js --help
3434
```
3535

3636
### Credits

json-to-go-v2.js

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env node
12
/*
23
JSON-to-Go v2
34
by Matt Holt
@@ -514,7 +515,7 @@ if (typeof module === 'undefined' || !module.parent) {
514515
const scriptname = path.basename(process.argv[1])
515516

516517
console.log(`\
517-
Usage: node ${scriptname} [OPTION]... [FILE]
518+
Usage: ${scriptname} [OPTION]... [FILE]
518519
Convert json to go file and prints the result on stdout.
519520
520521
Optional arguments:

json-to-go.js

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env node
12
/*
23
JSON-to-Go
34
by Matt Holt

0 commit comments

Comments
 (0)