mirror of
https://github.com/nextcloud/richdocuments.git
synced 2025-12-17 13:08:43 +01:00
Fixes #4565 - assets directory conflicts with assets API when the webserver is nginx
Signed-off-by: Andras Timar <andras.timar@collabora.com>
This commit is contained in:
parent
1f268dada7
commit
a79476128f
7 changed files with 8 additions and 8 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,7 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
/assets/fonts
|
||||
/fonts
|
||||
tests/clover.xml
|
||||
.idea
|
||||
node_modules/
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ SPDX-PackageSupplier = "Nextcloud <info@nextcloud.com>"
|
|||
SPDX-PackageDownloadLocation = "https://github.com/nextcloud/richdocuments"
|
||||
|
||||
[[annotations]]
|
||||
path = [".gitattributes", ".github/issue_template.md", ".github/CODEOWNERS", ".editorconfig", "package-lock.json", "package.json", "composer.json", "composer.lock", "**/composer.json", "**/composer.lock", ".l10nignore", "cypress/tsconfig.json", "vendor-bin/**/composer.json", "vendor-bin/**/composer.lock", ".tx/config", "tsconfig.json", "js/vendor.LICENSE.txt", "krankerl.toml", ".npmignore", ".nextcloudignore", ".eslintrc.json", ".tx/backport", "assets/fonts/.gitkeep"]
|
||||
path = [".gitattributes", ".github/issue_template.md", ".github/CODEOWNERS", ".editorconfig", "package-lock.json", "package.json", "composer.json", "composer.lock", "**/composer.json", "**/composer.lock", ".l10nignore", "cypress/tsconfig.json", "vendor-bin/**/composer.json", "vendor-bin/**/composer.lock", ".tx/config", "tsconfig.json", "js/vendor.LICENSE.txt", "krankerl.toml", ".npmignore", ".nextcloudignore", ".eslintrc.json", ".tx/backport", "fonts/.gitkeep"]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "none"
|
||||
SPDX-License-Identifier = "CC0-1.0"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Download font files and put them into the assets/fonts folder for the release
|
||||
# Download font files and put them into the fonts folder for the release
|
||||
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
FONTLIST=(
|
||||
|
|
@ -22,20 +22,20 @@ FONTLIST=(
|
|||
"https://github.com/google/fonts/raw/main/ofl/spectral/Spectral-Regular.ttf"
|
||||
)
|
||||
|
||||
rm assets/fonts/*
|
||||
rm fonts/*
|
||||
|
||||
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
|
||||
|
||||
for font in "${FONTLIST[@]}"; do
|
||||
echo "$font"
|
||||
wget -q -P assets/fonts/ $font
|
||||
wget -q -P fonts/ $font
|
||||
|
||||
FILENAME=$(urldecode "$(basename "$font")")
|
||||
|
||||
if [[ $FILENAME == *"wght"* ]]; then
|
||||
NEWFILENAME=$(echo $FILENAME | sed 's/\[wght\]/-wght/g')
|
||||
NEWFILENAME=$(echo $NEWFILENAME | sed 's/\[wdth,wght\]/-wdtg-wght/g')
|
||||
mv assets/fonts/$FILENAME assets/fonts/$NEWFILENAME
|
||||
mv fonts/$FILENAME fonts/$NEWFILENAME
|
||||
else
|
||||
NEWFILENAME=$(echo $FILENAME)
|
||||
fi
|
||||
|
|
@ -44,5 +44,5 @@ for font in "${FONTLIST[@]}"; do
|
|||
FONTNAME=$(echo $NEWFILENAME | sed 's/.ttf//g')
|
||||
|
||||
echo "$(dirname $font)/OFL.txt"
|
||||
wget -q -O "assets/fonts/$FONTNAME.LICENSE.txt" "$(dirname $font)/OFL.txt"
|
||||
wget -q -O "fonts/$FONTNAME.LICENSE.txt" "$(dirname $font)/OFL.txt"
|
||||
done
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ class FontService {
|
|||
* @throws Exception
|
||||
*/
|
||||
public function installDefaultFonts(): void {
|
||||
$dirPath = __DIR__ . '/../../assets/fonts';
|
||||
$dirPath = __DIR__ . '/../../fonts';
|
||||
|
||||
if (!is_dir($dirPath)) {
|
||||
throw new Exception("Directory \"$dirPath\" does not exist!");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue