From e71ace3aae18f69466bc2e82fff23c61f036f242 Mon Sep 17 00:00:00 2001 From: Ankit Dash Date: Wed, 10 Apr 2024 07:33:59 +0530 Subject: [PATCH 1/2] fix caching on windows machines --- .github/workflows/if-nodejs-pr-testing.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/if-nodejs-pr-testing.yml b/.github/workflows/if-nodejs-pr-testing.yml index 66ea65528b0..2f4a19c2f02 100644 --- a/.github/workflows/if-nodejs-pr-testing.yml +++ b/.github/workflows/if-nodejs-pr-testing.yml @@ -66,6 +66,17 @@ jobs: name: Install dependencies shell: bash run: npm ci + - if: steps.packagejson.outputs.exists == 'true' + name: Verify and conditionally clean npm cache + shell: bash + run: | + set +e + npm cache verify + VERIFY_EXIT_CODE=$? + set -e + if [ $VERIFY_EXIT_CODE -ne 0 ]; then + npm cache clean --force + fi - if: steps.packagejson.outputs.exists == 'true' name: Test run: npm test --if-present From 7fe1d836367f6d7c886103799736eebdd2b6e3bc Mon Sep 17 00:00:00 2001 From: Ankit Dash Date: Thu, 11 Apr 2024 01:42:46 +0530 Subject: [PATCH 2/2] fix generate command --- .github/workflows/if-nodejs-pr-testing.yml | 11 ----------- package.json | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/if-nodejs-pr-testing.yml b/.github/workflows/if-nodejs-pr-testing.yml index 2f4a19c2f02..66ea65528b0 100644 --- a/.github/workflows/if-nodejs-pr-testing.yml +++ b/.github/workflows/if-nodejs-pr-testing.yml @@ -66,17 +66,6 @@ jobs: name: Install dependencies shell: bash run: npm ci - - if: steps.packagejson.outputs.exists == 'true' - name: Verify and conditionally clean npm cache - shell: bash - run: | - set +e - npm cache verify - VERIFY_EXIT_CODE=$? - set -e - if [ $VERIFY_EXIT_CODE -ne 0 ]; then - npm cache clean --force - fi - if: steps.packagejson.outputs.exists == 'true' name: Test run: npm test --if-present diff --git a/package.json b/package.json index c1f11735f73..61c32a33bf3 100644 --- a/package.json +++ b/package.json @@ -140,7 +140,7 @@ "bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION", "dev": "tsc --watch", "docker:build": "docker build -t asyncapi/cli:latest .", - "generate:readme:create": "printf '\n\n# Usage\n\n\n\n# Commands\n\n\n' > scripts/README.md", + "generate:readme:create": "node -e \"const fs = require('fs'); fs.writeFileSync('scripts/README.md', '# Usage\\n\\n\\n\\n# Commands\\n\\n\\n');\"", "generate:readme:commands": "npm run build && cd scripts && cross-env DEBUG=* oclif readme", "generate:assets": "npm run generate:readme:toc && npm run generate:commands", "generate:commands": "npm run generate:readme:create && npm run generate:readme:commands && node ./scripts/updateUsageDocs.js && rimraf ./scripts/README.md",