diff --git a/restart.sh b/restart.sh index dcdbab9053366cde684c2de1ca3e4437910c99f0..eabcbe4542c2297aa5b2ae1d94830bf85f0d2be4 100755 --- a/restart.sh +++ b/restart.sh @@ -10,6 +10,16 @@ function kill_teedoc() { function teedoc_build() { teedoc build + ret=$? + retry_count=1 + # 等于1表示,文件夹存在,重新运行 + while ((ret==1)) + do + teedoc build + ret=$? + let "retry_count=$retry_count+1" + echo $retry_count + done } function restart() { @@ -71,6 +81,10 @@ function copy_file() { python3 script/auto_creat_toc.py --input_file pages/index/zh/config.json --action copy } +function apply_patch() { + . script/fix_icon_as_lower_right_corner.sh +} + case $1 in "start") start @@ -97,6 +111,7 @@ case $1 in teedoc_src_release ;; "publish") + apply_patch teedoc_publish_to_server $2 ;; @@ -108,6 +123,9 @@ case $1 in # 覆盖相同的文档 copy_file ;; +"patch") + apply_patch + ;; *) if [ $# = 0 ]; then # 没有参数,默认 diff --git a/script/fix_icon_as_lower_right_corner.sh b/script/fix_icon_as_lower_right_corner.sh new file mode 100755 index 0000000000000000000000000000000000000000..c085ea08076d84220c3659e23a2b9812ae3a861c --- /dev/null +++ b/script/fix_icon_as_lower_right_corner.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# 修复右下角图标的错误 +echo "修改 out/doc/static/css/theme_default/light.css" +sed -i "s@url(/static/image/theme_default/to-top.svg)@url(/doc/static/image/theme_default/to-top.svg)@g" out/doc/static/css/theme_default/light.css