Skip to content

Commit b692d7d

Browse files
committed
chore: add helpers for generating examples
Usage: $ npm run gen-js-example $ npm run gen-go-example $ npm run gen-py-example
1 parent 6dfd934 commit b692d7d

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

.github/workflows/generate-go-app.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ jobs:
2121
- name: Install project dependencies
2222
run: npm ci --no-audit --no-fund # https://docs.npmjs.com/cli/v8/commands/npm-ci
2323
- name: Generate Golang + Chi application
24-
run: ../../src/cli.js --lang go
25-
working-directory: examples/go
24+
run: npm run generate-go-example
2625
- name: Check whether all modified files have been committed
2726
run: >-
2827
MODIFIED_FILES="$(git status --short)";

.github/workflows/generate-js-app.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ jobs:
2121
- name: Install project dependencies
2222
run: npm ci --no-audit --no-fund # https://docs.npmjs.com/cli/v8/commands/npm-ci
2323
- name: Generate JavaScript + Express application
24-
run: ../../src/cli.js --lang js
25-
working-directory: examples/js
24+
run: npm run generate-js-example
2625
- name: Check whether all modified files have been committed
2726
run: >-
2827
MODIFIED_FILES="$(git status --short)";

.github/workflows/generate-python-app.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ jobs:
2121
- name: Install project dependencies
2222
run: npm ci --no-audit --no-fund # https://docs.npmjs.com/cli/v8/commands/npm-ci
2323
- name: Generate Python + FastAPI application
24-
run: ../../src/cli.js --lang python
25-
working-directory: examples/python
24+
run: npm run generate-py-example
2625
- name: Check whether all modified files have been committed
2726
run: >-
2827
MODIFIED_FILES="$(git status --short)";

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727
],
2828
"scripts": {
2929
"start": "node src/index.js",
30-
"test": "echo \"Error: no test specified\" && exit 1"
30+
"test": "echo \"Error: no test specified\" && exit 1",
31+
"gen-js-example": "cd examples/js; ../../src/cli.js --lang js",
32+
"gen-go-example": "cd examples/go; ../../src/cli.js --lang go",
33+
"gen-py-example": "cd examples/python; ../../src/cli.js --lang python"
3134
},
3235
"dependencies": {
3336
"ejs": "~3.1.9",

0 commit comments

Comments
 (0)