Browse Source

tool: Don't add prefixes to references in other files

pull/169/head
jld3103 2 years ago
parent
commit
3e103a4925
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 2
      tool/generate-nextcloud.sh

2
tool/generate-nextcloud.sh

@ -19,7 +19,7 @@ for i in $(seq 0 $((${#codenames[@]} - 1))); do
-s \ -s \
'.[] '.[]
| .components.schemas = (.components.schemas | with_entries(.key = if .key == "OCSMeta" or .key == "EmptyOCS" then .key else $prefix + .key end)) | .components.schemas = (.components.schemas | with_entries(.key = if .key == "OCSMeta" or .key == "EmptyOCS" then .key else $prefix + .key end))
| walk(if type == "object" and has("$ref") and ."$ref" != "#/components/schemas/OCSMeta" and ."$ref" != "#/components/schemas/EmptyOCS" then ."$ref" |= sub("#/components/schemas/";"#/components/schemas/" + $prefix) else . end)' \ | walk(if type == "object" and has("$ref") and ."$ref" != "#/components/schemas/OCSMeta" and ."$ref" != "#/components/schemas/EmptyOCS" then ."$ref" |= sub("^#/components/schemas/";"#/components/schemas/" + $prefix) else . end)' \
/tmp/nextcloud-neon/"$codename".json \ /tmp/nextcloud-neon/"$codename".json \
> /tmp/nextcloud-neon/"$codename"-prefixed.json > /tmp/nextcloud-neon/"$codename"-prefixed.json

Loading…
Cancel
Save