@team-supercharge/oasg 13.2.0-feature-csharp-functions-36681406.0 → 13.2.0-feature-csharp-functions-100d975c.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-supercharge/oasg",
3
- "version": "13.2.0-feature-csharp-functions-36681406.0",
3
+ "version": "13.2.0-feature-csharp-functions-100d975c.0",
4
4
  "description": "Node-based tool to lint OpenAPI documents and generate clients, servers and documentation from them",
5
5
  "author": "Supercharge",
6
6
  "license": "MIT",
package/targets/common.sh CHANGED
@@ -1,3 +1,5 @@
1
+ #!/bin/bash
2
+
1
3
  # command line arguments:
2
4
  # 1. version - semantic version string
3
5
  # 2. binary - openapi-generator JAR file
@@ -21,10 +23,12 @@ templateDir=$9
21
23
 
22
24
  echo -e "\n=====\n version:\t$version\n binary:\t$binary\n configFile:\t$configFile\n targetId:\t$targetId\n generatorId:\t$generatorId\n openApiFile:\t$openApiFile\n formatter:\t$formatterBinary\n preRelease:\t$preRelease\n templateDir:\t$templateDir\n ---"
23
25
 
24
- for paramName in $(cat $configFile | jq -r ".targets[] | select(.id==\"$targetId\") | del(.id) | del(.type) | del(.source) | del(.generator) | del(.generatorId) | del(.templateDir) | keys | .[]"); do
25
- result=$(cat $configFile | jq -r ".targets[] | select(.id==\"$targetId\") | .$paramName")
26
- echo -e " $paramName:\t$result"
27
- eval $paramName="'$result'"
26
+ target=$(jq -r --arg targetId "$targetId" '.targets[] | select(.id==$targetId) | del(.id, .type, .source, .generator, .generatorId, .templateDir)' "$configFile")
27
+
28
+ for paramName in $(echo "$target" | jq -r 'keys | .[]'); do
29
+ result=$(echo "$target" | jq -r --arg paramName "$paramName" '.[$paramName]')
30
+ echo -e " $paramName:\t$result"
31
+ eval $paramName="'$result'"
28
32
  done
29
33
 
30
34
  echo -e "=====\n"