mirror of
https://code.castopod.org/adaures/castopod
synced 2025-04-19 13:01:19 +00:00
ci(gitlabci): filter out docs src languages not declared in .i18n-filter file before build
This commit is contained in:
parent
79c553cbad
commit
b870ce55bc
@ -7,6 +7,8 @@ stages:
|
|||||||
.documentation-setup:
|
.documentation-setup:
|
||||||
before_script:
|
before_script:
|
||||||
- cd docs
|
- cd docs
|
||||||
|
- chmod +x ./scripts/i18n-filter.sh
|
||||||
|
- ./scripts/i18n-filter.sh
|
||||||
- npm ci
|
- npm ci
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
|
29
docs/scripts/i18n-filter.sh
Executable file
29
docs/scripts/i18n-filter.sh
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# This script deletes language files not declared in the .i18n-filter file
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Exit if the directory isn't found
|
||||||
|
if [ ! -d $1 ]
|
||||||
|
then
|
||||||
|
echo "$1 directory does not exist."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd $1
|
||||||
|
|
||||||
|
# Exit if the .i18n-filter isn't found
|
||||||
|
if [[ -f .i18n-filter ]]
|
||||||
|
then
|
||||||
|
# delete all languages not present in .i18n-filter
|
||||||
|
for i in *; do
|
||||||
|
if ! grep -qxFe "$i" .i18n-filter; then
|
||||||
|
echo "Deleting: $i"
|
||||||
|
|
||||||
|
rm -rf "$i"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "$1/.i18n-filter file not found!"
|
||||||
|
exit
|
||||||
|
fi
|
4
docs/src/.i18n-filter
Normal file
4
docs/src/.i18n-filter
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
public
|
||||||
|
contributing
|
||||||
|
getting-started
|
||||||
|
index.md
|
Loading…
x
Reference in New Issue
Block a user