Skip to content

Commit 236d8bf

Browse files
committed
🔧 Add setup script. Update README.md
1 parent 8ee67af commit 236d8bf

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
# api-to-go
22

3-
Convert Rest API's JSON payload to Golang struct.
3+
Convert REST API's JSON payload to Golang struct.
44
using [json-to-go](https://github.com/mholt/json-to-go)
55

66
# Install
77
```sh
88
git clone https://github.com/nkmr-jp/api-to-go.git
99
cd api-to-go
10-
yarn install
11-
yarn fetch # fetch json-to-go code
12-
npm link # make the command available
10+
yarn setup
1311
```
1412

1513
# Usage
1614
```sh
17-
api-to-go https://api.github.com/users/github
15+
cd [your project dir]
16+
api-to-go https://api.github.com/users
17+
# > ...
18+
# > generated: api.github.com/users.go
1819
```
1920

2021
```sh

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
},
1010
"homepage": "https://github.com/nkmr-jp/api-to-go#readme",
1111
"scripts": {
12-
"fetch": "rm -rf ./vendor && mkdir -p vendor && cd vendor && git clone https://github.com/mholt/json-to-go.git"
12+
"fetch": "rm -rf ./vendor && mkdir -p vendor && cd vendor && git clone https://github.com/mholt/json-to-go.git",
13+
"setup": "yarn install && yarn fetch && npm -f link && exec $SHELL -l"
1314
},
14-
"description": "Convert Rest API's JSON payload to Golang struct.",
15+
"description": "Convert REST API's JSON payload to Golang struct.",
1516
"bin": {
1617
"api-to-go": "bin/api-to-go.js"
1718
},

0 commit comments

Comments
 (0)