diff --git a/customization/check.sh b/customization/check.sh index 28611e9..18616aa 100755 --- a/customization/check.sh +++ b/customization/check.sh @@ -106,10 +106,19 @@ if [[ -d ${ROOT}/issue-templates ]]; then ! grep -rq "example.com" "${ROOT}/issue-templates/" && ok "Issue 模板已无 example.com 占位链接" || bad "Issue 模板里仍有 example.com" fi -if [[ -f ${ROOT}/custom/options/locale/locale_zh-CN.json ]]; then - ! grep -q "工单" "${ROOT}/custom/options/locale/locale_zh-CN.json" && +if [[ -f ${ROOT}/customization/custom/options/locale/locale_zh-CN.json ]]; then + ! grep -q "工单" "${ROOT}/customization/custom/options/locale/locale_zh-CN.json" && ok "生成的 zh-CN 语言文件已无「工单」" || bad "语言文件里仍有「工单」" fi +# 首页(登录后)的学期答疑入口卡片: 渲染结果需要登录才能看, 这里只断言模板层 +# (运行时的渲染断言在 customization/preview/preview.sh check 里, 要登录)。 +if [[ -f ${ROOT}/customization/custom/templates/custom/tjhlp_semester_card.tmpl ]]; then + grep -q "本学期答疑入口" "${ROOT}/customization/custom/templates/custom/tjhlp_semester_card.tmpl" && + ok "首页答疑入口卡片模板在位" || bad "卡片模板里没有预期的内容" + grep -q 'template "custom/tjhlp_semester_card"' \ + "${ROOT}/customization/custom/templates/user/dashboard/dashboard.tmpl" && + ok "dashboard.tmpl 已 include 学期答疑入口卡片" || bad "dashboard.tmpl 没有 include 卡片" +fi if [[ ${fail} == 0 ]]; then echo "全部检查通过"