From b692d7de1802d1aa9fa0ab00359205ee997345c0 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Fri, 7 Jul 2023 09:30:55 +0700 Subject: [PATCH] chore: add helpers for generating examples Usage: $ npm run gen-js-example $ npm run gen-go-example $ npm run gen-py-example --- .github/workflows/generate-go-app.yml | 3 +-- .github/workflows/generate-js-app.yml | 3 +-- .github/workflows/generate-python-app.yml | 3 +-- package.json | 5 ++++- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/generate-go-app.yml b/.github/workflows/generate-go-app.yml index 3a7d085..7b5e62e 100644 --- a/.github/workflows/generate-go-app.yml +++ b/.github/workflows/generate-go-app.yml @@ -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)"; diff --git a/.github/workflows/generate-js-app.yml b/.github/workflows/generate-js-app.yml index ff00cb7..976e643 100644 --- a/.github/workflows/generate-js-app.yml +++ b/.github/workflows/generate-js-app.yml @@ -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)"; diff --git a/.github/workflows/generate-python-app.yml b/.github/workflows/generate-python-app.yml index a03b4dc..2b1bea5 100644 --- a/.github/workflows/generate-python-app.yml +++ b/.github/workflows/generate-python-app.yml @@ -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)"; diff --git a/package.json b/package.json index 8232178..8ebdeae 100644 --- a/package.json +++ b/package.json @@ -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",