37 lines
1.1 KiB
Bash
37 lines
1.1 KiB
Bash
#!/usr/bin/env sh
|
|
# cron
|
|
# 0 4 * * * . /etc/profile; /bin/sh /opt/ld-site/script/build_on_linux.sh >/dev/null 2>&1
|
|
|
|
export PATH=$PATH:/opt/dev_tools/node-v20.12.2-linux-x64/bin
|
|
|
|
script_path="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
|
original_article_home="/home/ld/Documents/ld_article"
|
|
original_article_destination="/opt/ld-site/src/content"
|
|
ld_site_dist_target="/opt/nginx_targets/ld_site_dist"
|
|
translation_article_path="/opt/nginx_targets/file_share/translation"
|
|
|
|
rsync -a --delete-after -f"P config.ts" \
|
|
"${original_article_home}/" \
|
|
"${original_article_destination}/"
|
|
|
|
cd "${original_article_destination}/translation"
|
|
makeinfo --html --no-split --css-include=theme.css ./*.texi
|
|
if [ $? -ne 0 ]; then
|
|
echo "cannot generate translation article, check 'makeinfo' command output."
|
|
exit 1
|
|
fi
|
|
rm -rf "${translation_article_path}/*.html"
|
|
mv ./*.html "${translation_article_path}/"
|
|
|
|
cd "${script_path}/../"
|
|
npm run build
|
|
|
|
if [ $? -ne 0 ]; then
|
|
echo "cannot build ld_site."
|
|
exit 1
|
|
fi
|
|
|
|
mv ${ld_site_dist_target} "${ld_site_dist_target}_old"
|
|
mv dist ${ld_site_dist_target}
|
|
rm -rf "${ld_site_dist_target}_old"
|