Skip to main content

2 posts tagged with "Shell"

View All Tags

· 9 min read

本文以 pingcap-docsite-preview 项目中的测试框架为例,介绍如何使用 Python 测试 Shell 脚本。

pingcap-docsite-preview 是一个用于预览文档内容的项目。它使用一些 Shell 脚本更新文档网站的内容。为了确保 Shell 脚本的代码质量和功能正确性,该项目使用 Python 构建了一个测试 Shell 脚本的框架。

下面以测试 sync_scaffold.sh 为例,该脚本用于更新 markdown-pages 目录以及 docs.json 文件内容。

· 9 min read

Scenario

When maintaining a Git repository, particularly one for documentation, it is common to have files that haven't been updated in a while. To address this issue, you can link a section or sentence in the document to the corresponding code or an existing issue, so that the document can be updated when the code changes or the issue is resolved. This is useful when starting a new project, but it can be difficult to maintain these links for an existing large project.

To identify potential outdated files, you can use the git log command to retrieve the last commit log of each file and find long-term inactive files. The following sections describe how to generate a last commit report for a repository and how to write the script step by step.