Skip to content
Snippets Groups Projects
Commit b870ce55 authored by Yassine Doghri's avatar Yassine Doghri
Browse files

ci(gitlabci): filter out docs src languages not declared in .i18n-filter file before build

parent 79c553cb
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,8 @@ stages:
.documentation-setup:
before_script:
- cd docs
- chmod +x ./scripts/i18n-filter.sh
- ./scripts/i18n-filter.sh
- npm ci
cache:
......
#!/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
public
contributing
getting-started
index.md
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment