From 0daa3a9252c4fa69ee092967a22c399f45f7b6d1 Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Tue, 9 Nov 2021 13:14:41 -0500 Subject: [PATCH] Skip i18n-specific things if website is not i18n --- lektor.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/lektor.yml b/lektor.yml index 3a1ec63..de0580a 100644 --- a/lektor.yml +++ b/lektor.yml @@ -37,18 +37,24 @@ pages: stage: build script: - *apt-template - - DEBIAN_FRONTEND=noninteractive apt-get install gettext python3-babel python3-pip git python3-inifile python3-dev python3-setuptools python3-openssl python3-cryptography python3-venv i18nspector apt-utils ca-certificates -y + - DEBIAN_FRONTEND=noninteractive apt-get install python3-pip git python3-inifile python3-dev python3-setuptools python3-openssl python3-cryptography python3-venv apt-utils ca-certificates -y - python3 -m venv venv - source venv/bin/activate - pip3 install lektor - - echo 'checking out translations' - - rm -rf i18n - - git clone --branch $TRANSLATION_BRANCH --depth=1 https://git.torproject.org/translation.git i18n - - echo 'reinstall lektor plugins' - - lektor project-info --output-path - - lektor plugins reinstall - - 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 + - > + if [ -n "${TRANSLATION_BRANCH}" ]; then + DEBIAN_FRONTEND=noninteractive apt-get install gettext python3-babel i18nspector + echo 'checking out translations' + rm -rf i18n + git clone --branch "${TRANSLATION_BRANCH}" --depth=1 https://git.torproject.org/translation.git i18n + echo 'reinstall lektor plugins' + lektor project-info --output-path + lektor plugins reinstall + 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 + lektor build --output-path public + fi artifacts: paths: - public -- GitLab