Skip to content

Commit 3647948

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

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

README.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,23 @@ Contributions are welcome! Open a pull request to fix a bug, or open an issue to
2020
node json-to-go.js sample.json
2121
```
2222

23+
- Read JSON file on Unix systems:
24+
25+
```sh
26+
./json-to-go.js sample.json
27+
```
28+
2329
- Read JSON file from stdin:
2430

2531
```sh
26-
node json-to-go.js < sample.json
27-
cat sample.json | node json-to-go.js
32+
./json-to-go.js < sample.json
33+
cat sample.json | ./json-to-go.js
2834
```
2935

3036
- For more options, check the help page
3137

3238
```sh
33-
node json-to-go.js --help
39+
./json-to-go.js --help
3440
```
3541

3642
### Credits

json-to-go-v2.js

100644100755
+2-1
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
+1
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)