File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22set -euo pipefail
33
4+ # # NOTE: Use JS script instead.
5+ # # Script is kept only for backwards compatibilty
6+
47# ########################################################
58# Prepare collection for Postman API
69# Environment variables:
@@ -27,7 +30,6 @@ DESCRIPTION_FILE=${DESCRIPTION_FILE:-"../collection-description.md"}
2730
2831TOGGLE_INCLUDE_BODY=${TOGGLE_INCLUDE_BODY:- true}
2932TOGGLE_ADD_DOCS_LINKS=${TOGGLE_ADD_DOCS_LINKS:- true}
30- TOKEN_URL_ENV=${TOKEN_URL_ENV:- " " }
3133
3234current_api_revision=$( < " $OPENAPI_FOLDER /$VERSION_FILE_NAME " )
3335
@@ -117,13 +119,10 @@ else
117119 cp intermediateCollectionWithLinks.json intermediateCollectionPostBody.json
118120fi
119121
120- if [ " $TOKEN_URL_ENV " != " " ]; then
121- echo " Adding client credentials auth url variable $TOKEN_URL_ENV "
122- jq --arg token_url " $TOKEN_URL_ENV " ' .collection.variable += [{"key": "clientCredentialsTokenUrl", "value": $token_url}]' \
123- intermediateCollectionPostBody.json > " $COLLECTION_TRANSFORMED_FILE_NAME "
124- else
125- cp intermediateCollectionPostBody.json " $COLLECTION_TRANSFORMED_FILE_NAME "
126- fi
122+ # Remove trailing whitespaces by reformatting the JSON
123+ echo " Removing trailing whitespaces from the final JSON file"
124+ jq ' .' " $COLLECTION_TRANSFORMED_FILE_NAME " > tmp.json && mv tmp.json " $COLLECTION_TRANSFORMED_FILE_NAME "
125+
127126
128127# Clean up temporary files
129128echo " Removing temporary files"
You can’t perform that action at this time.
0 commit comments