📦️(mail) make DIR_MAILS variable configurable

That allows downstream packages to e.g. split the builds of
frontend/backend/mail, as it's the case in nixpkgs:
5597a4f8f9
This commit is contained in:
Maximilian Bosch
2025-08-29 10:00:43 +02:00
committed by GitHub
parent d5c9eaca5a
commit 2451a6a322
2 changed files with 13 additions and 13 deletions

View File

@@ -1,22 +1,22 @@
#!/usr/bin/env bash
set -eo pipefail
# Run html-to-text to convert all html files to text files
DIR_MAILS="../backend/core/templates/mail/"
DOCS_DIR_MAILS="${DOCS_DIR_MAILS:-../backend/core/templates/mail}/"
if [ ! -d "${DIR_MAILS}" ]; then
mkdir -p "${DIR_MAILS}";
if [ ! -d "${DOCS_DIR_MAILS}" ]; then
mkdir -p "${DOCS_DIR_MAILS}";
fi
if [ ! -d "${DIR_MAILS}"html/ ]; then
mkdir -p "${DIR_MAILS}"html/;
if [ ! -d "${DOCS_DIR_MAILS}"html/ ]; then
mkdir -p "${DOCS_DIR_MAILS}"html/;
exit;
fi
for file in "${DIR_MAILS}"html/*.html;
for file in "${DOCS_DIR_MAILS}"html/*.html;
do html-to-text -j ./html-to-text.config.json < "$file" > "${file%.html}".txt; done;
if [ ! -d "${DIR_MAILS}"text/ ]; then
mkdir -p "${DIR_MAILS}"text/;
if [ ! -d "${DOCS_DIR_MAILS}"text/ ]; then
mkdir -p "${DOCS_DIR_MAILS}"text/;
fi
mv "${DIR_MAILS}"html/*.txt "${DIR_MAILS}"text/;
mv "${DOCS_DIR_MAILS}"html/*.txt "${DOCS_DIR_MAILS}"text/;

View File

@@ -1,9 +1,9 @@
#!/usr/bin/env bash
# Run mjml command to convert all mjml templates to html files
DIR_MAILS="../backend/core/templates/mail/html/"
DOCS_DIR_MAILS="${DOCS_DIR_MAILS:-../backend/core/templates/mail}/html/"
if [ ! -d "${DIR_MAILS}" ]; then
mkdir -p "${DIR_MAILS}";
if [ ! -d "${DOCS_DIR_MAILS}" ]; then
mkdir -p "${DOCS_DIR_MAILS}";
fi
mjml mjml/*.mjml -o "${DIR_MAILS}";
mjml mjml/*.mjml -o "${DOCS_DIR_MAILS}";