mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-06 04:21:09 +00:00
13 lines
637 B
Bash
13 lines
637 B
Bash
#!/bin/bash
|
|
|
|
set -eo pipefail # Fail on script errors
|
|
|
|
# Clone the repo with test openapi files:
|
|
git clone https://github.com/Rebilly/api-definitions.git
|
|
|
|
# Store the command into a text file:
|
|
echo hyperfine -i --warmup 3 $(cat package.json | jq '.dependencies' | jq 'keys' | jq 'map("'\''node node_modules/" + . + "/bin/cli.js lint api-definitions/openapi/openapi.yaml'\''")' | jq 'join(" ")' | xargs) --export-markdown benchmark_check.md --export-json benchmark_check.json > test-command.txt
|
|
|
|
# Put the command in the test section of the package.json:
|
|
cat package.json | jq ".scripts.test = \"$(cat test-command.txt)\"" > package.json
|