Skip to content

Commit

Permalink
chore: add helpers for generating examples
Browse files Browse the repository at this point in the history
Usage:
$ npm run gen-js-example
$ npm run gen-go-example
$ npm run gen-py-example
  • Loading branch information
php-coder committed Jul 7, 2023
1 parent 6dfd934 commit b692d7d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/generate-go-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
- name: Install project dependencies
run: npm ci --no-audit --no-fund # https://docs.npmjs.com/cli/v8/commands/npm-ci
- name: Generate Golang + Chi application
run: ../../src/cli.js --lang go
working-directory: examples/go
run: npm run generate-go-example
- name: Check whether all modified files have been committed
run: >-
MODIFIED_FILES="$(git status --short)";
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/generate-js-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
- name: Install project dependencies
run: npm ci --no-audit --no-fund # https://docs.npmjs.com/cli/v8/commands/npm-ci
- name: Generate JavaScript + Express application
run: ../../src/cli.js --lang js
working-directory: examples/js
run: npm run generate-js-example
- name: Check whether all modified files have been committed
run: >-
MODIFIED_FILES="$(git status --short)";
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/generate-python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
- name: Install project dependencies
run: npm ci --no-audit --no-fund # https://docs.npmjs.com/cli/v8/commands/npm-ci
- name: Generate Python + FastAPI application
run: ../../src/cli.js --lang python
working-directory: examples/python
run: npm run generate-py-example
- name: Check whether all modified files have been committed
run: >-
MODIFIED_FILES="$(git status --short)";
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
],
"scripts": {
"start": "node src/index.js",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"gen-js-example": "cd examples/js; ../../src/cli.js --lang js",
"gen-go-example": "cd examples/go; ../../src/cli.js --lang go",
"gen-py-example": "cd examples/python; ../../src/cli.js --lang python"
},
"dependencies": {
"ejs": "~3.1.9",
Expand Down

0 comments on commit b692d7d

Please sign in to comment.