diff --git a/codegen.sh b/codegen.sh index 782d8c9..dc95820 100755 --- a/codegen.sh +++ b/codegen.sh @@ -15,26 +15,26 @@ OS="$(uname)" case "$OS" in - 'Linux') - OS='linux' - SED_IFLAG=(-i'') - ;; - 'Darwin') - OS='macos' - SED_IFLAG=(-i '') - ;; - *) - echo "Operating system '$OS' not supported." - exit 1 - ;; + 'Linux') + OS='linux' + SED_IFLAG=(-i'') + ;; + 'Darwin') + OS='macos' + SED_IFLAG=(-i '') + ;; + *) + echo "Operating system '$OS' not supported." + exit 1 + ;; esac OUTPUT_FILE=api.json # Bundle yaml -swagger-cli bundle api.yaml -o "$OUTPUT_FILE"; +swagger-cli bundle api.yaml -o "$OUTPUT_FILE" # Remove newlines from descriptions -sed "${SED_IFLAG[@]}" 's/\\n\\n/\\n/g' "$OUTPUT_FILE"; -sed "${SED_IFLAG[@]}" 's/\\n/ /g' "$OUTPUT_FILE"; -sed "${SED_IFLAG[@]}" 's/ "/"/g' "$OUTPUT_FILE"; +sed "${SED_IFLAG[@]}" 's/\\n\\n/\\n/g' "$OUTPUT_FILE" +sed "${SED_IFLAG[@]}" 's/\\n/ /g' "$OUTPUT_FILE" +sed "${SED_IFLAG[@]}" 's/ "/"/g' "$OUTPUT_FILE"