diff --git a/package.json b/package.json index 8b872bc..7646f98 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,11 @@ "scripts": { "postman:lint": "./scripts/lint-collections.sh", "postman:run": "./scripts/run-collection.sh", - "postman:run:fleetbase": "./scripts/run-collection.sh postman/collections/Fleetbase API", - "postman:run:core": "./scripts/run-collection.sh postman/collections/Fleetbase Core API", - "postman:run:storefront": "./scripts/run-collection.sh postman/collections/Fleetbase Storefront API", - "postman:run:ledger": "./scripts/run-collection.sh postman/collections/Fleetbase Ledger API", - "postman:run:integrated-vendor": "./scripts/run-collection.sh postman/collections/Fleetbase Integrated Vendor Flow" + "postman:run:fleetbase": "./scripts/run-collection.sh 'postman/collections/Fleetbase API'", + "postman:run:core": "./scripts/run-collection.sh 'postman/collections/Fleetbase Core API'", + "postman:run:storefront": "./scripts/run-collection.sh 'postman/collections/Fleetbase Storefront API'", + "postman:run:ledger": "./scripts/run-collection.sh 'postman/collections/Fleetbase Ledger API'", + "postman:run:integrated-vendor": "./scripts/run-collection.sh 'postman/collections/Fleetbase Integrated Vendor Flow'" }, "keywords": [ "fleetbase", diff --git a/scripts/lint-collections.sh b/scripts/lint-collections.sh index f8497cd..b3593fa 100755 --- a/scripts/lint-collections.sh +++ b/scripts/lint-collections.sh @@ -4,12 +4,11 @@ set -eu node ./scripts/validate-collections.js if command -v postman >/dev/null 2>&1; then - yaml_files="$(find ./postman/collections -name '*.yaml' -print)" - if [ -n "$yaml_files" ]; then - for yaml_file in $yaml_files; do - postman collection lint "$yaml_file" --fail-severity error - done - fi + for collection in ./postman/collections/*/; do + [ -d "$collection" ] || continue + echo "Linting $(basename "$collection")..." + postman collection lint "$collection" --fail-severity error + done else echo "Postman CLI not found; skipped v3 YAML schema lint." fi