From d7c70d0367c8df0543ba8d66de0cf9eac108a28b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Wed, 14 May 2025 18:28:29 +0200 Subject: [PATCH] fix(core): force sorting mimetypenames.dist.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- resources/config/mimetypenames-update.sh | 8 ++++++-- resources/config/mimetypenames.dist.json | 18 ++++++++---------- .../config/mimetypenames.dist.json.license | 2 ++ 3 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 resources/config/mimetypenames.dist.json.license diff --git a/resources/config/mimetypenames-update.sh b/resources/config/mimetypenames-update.sh index 876a467bd26..c64d961136f 100755 --- a/resources/config/mimetypenames-update.sh +++ b/resources/config/mimetypenames-update.sh @@ -1,4 +1,8 @@ #!/bin/bash + +# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: AGPL-3.0-or-later + set -e # Paths @@ -48,8 +52,8 @@ while read -r MIME; do fi done <<< "$MIME_TYPES" -# Final formatting -jq '.' "$OUTPUT_JSON.tmp" > "$OUTPUT_JSON" && rm "$OUTPUT_JSON.tmp" +# Final formatting and sorting by keys +jq -S . "$OUTPUT_JSON.tmp" > "$OUTPUT_JSON" && rm "$OUTPUT_JSON.tmp" echo "✅ Done!" echo "✔️ Descriptions found for $MATCHED_COUNT MIME types" diff --git a/resources/config/mimetypenames.dist.json b/resources/config/mimetypenames.dist.json index 190efa2562c..29d9d6828d3 100644 --- a/resources/config/mimetypenames.dist.json +++ b/resources/config/mimetypenames.dist.json @@ -1,12 +1,10 @@ { - "_comment" : "Array of human readable mimes.", - "_comment2": "Any changes you make here will be overwritten on an update of Nextcloud.", - "_comment3": "Put any custom mappings in a new file mimetypenames.json in the config/ folder of Nextcloud", - - "_comment4": "After any change to mimetypenames.json run:", - "_comment5": "./occ maintenance:mimetype:update-js", - "_comment6": "Otherwise your update won't propagate through the system.", - + "_comment": "Array of human readable mimes.", + "_comment2": "Any changes you make here will be overwritten on an update of Nextcloud.", + "_comment3": "Put any custom mappings in a new file mimetypenames.json in the config/ folder of Nextcloud", + "_comment4": "After any change to mimetypenames.json run:", + "_comment5": "./occ maintenance:mimetype:update-js", + "_comment6": "Otherwise your update won't propagate through the system.", "application/epub+zip": "Electronic book document", "application/gpx+xml": "GPX geographic data", "application/gzip": "Gzip archive", @@ -32,6 +30,7 @@ "application/vnd.ms-powerpoint.slideshow.macroEnabled.12": "PowerPoint presentation", "application/vnd.ms-powerpoint.template.macroEnabled.12": "PowerPoint presentation template", "application/vnd.ms-word.document.macroEnabled.12": "Word document", + "application/vnd.oasis.opendocument.formula": "ODF formula", "application/vnd.oasis.opendocument.graphics": "ODG drawing", "application/vnd.oasis.opendocument.graphics-flat-xml": "ODG drawing (Flat XML)", "application/vnd.oasis.opendocument.graphics-template": "ODG template", @@ -109,6 +108,5 @@ "video/webm": "WebM video", "video/x-flv": "Flash video", "video/x-matroska": "Matroska video", - "video/x-ms-wmv": "Windows Media video", - "application/vnd.oasis.opendocument.formula": "ODF formula" + "video/x-ms-wmv": "Windows Media video" } diff --git a/resources/config/mimetypenames.dist.json.license b/resources/config/mimetypenames.dist.json.license new file mode 100644 index 00000000000..a46df3694b6 --- /dev/null +++ b/resources/config/mimetypenames.dist.json.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors +SPDX-License-Identifier: AGPL-3.0-only \ No newline at end of file