Commit 1abf2a6a authored by Jérôme Charaoui's avatar Jérôme Charaoui 🔭
Browse files

Remove packages/i18n when it's not needed for build

When TRANSLATION_BRANCH is undefined, we're not building a website which
needs translations. However because of the way many website projects
integrate `lego` packages, by symlinking `packages/` to `lego/packages/`,
such builds are always created with the `i18n` plugin present.

This is *not* harmless: at present, if a python >=3.9 build environment
is used, this plugin will corrupt *all* builds with PO-file garbage.

By removing the plugin prior to a deployment build, we work around this
problem, while at the same time likely improve build times.
parent 00cd728f
Pipeline #17580 passed with stage
in 30 seconds
......@@ -53,6 +53,11 @@ pages:
echo 'building lektor 3 more times to get translations in place'
lektor build --output-path public && lektor build --output-path public && lektor build --output-path public
else
# 'packages' may be a symlink to lego, which may include 'i18n'
# it's not needed at all to build a site without translations
# remove it before build, since this plugin is known to cause
# problems in some environments (eg. python >=3.9)
[ -e packages/i18n ] && rm -rf packages/i18n
lektor build --output-path public
fi
artifacts:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment