mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-07-01 15:35:24 +02:00
CI: check if the page title is up-to-date (#13654)
This commit is contained in:
parent
370710ebd8
commit
da8862ffb4
1 changed files with 14 additions and 0 deletions
|
@ -121,6 +121,16 @@ function check_more_info_link() {
|
|||
fi
|
||||
}
|
||||
|
||||
function check_page_title() {
|
||||
local page=$1
|
||||
|
||||
grep "$page" "page-titles.txt" > /dev/null
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
printf "\x2d $MSG_PAGE_TITLE" "$page"
|
||||
fi
|
||||
}
|
||||
|
||||
# Look at git diff and check for copied/duplicated pages.
|
||||
function check_diff {
|
||||
local git_diff
|
||||
|
@ -137,6 +147,7 @@ function check_diff {
|
|||
fi
|
||||
|
||||
python3 scripts/set-more-info-link.py -Sn > more-info-links.txt
|
||||
python3 scripts/set-page-title.py -Sn > page-titles.txt
|
||||
|
||||
while read line; do
|
||||
readarray -td$'\t' entry < <(echo -n "$line")
|
||||
|
@ -159,11 +170,13 @@ function check_diff {
|
|||
check_missing_english_page "$file1"
|
||||
check_outdated_page "$file1"
|
||||
check_more_info_link "$file1"
|
||||
check_page_title "$file1"
|
||||
;;
|
||||
M) # file1 was modified
|
||||
check_missing_english_page "$file1"
|
||||
check_outdated_page "$file1"
|
||||
check_more_info_link "$file1"
|
||||
check_page_title "$file1"
|
||||
;;
|
||||
esac
|
||||
done <<< "$git_diff"
|
||||
|
@ -198,6 +211,7 @@ MSG_NOT_DIR='The file `%s` does not look like a directory.\n'
|
|||
MSG_NOT_FILE='The file `%s` does not look like a regular file.\n'
|
||||
MSG_NOT_MD='The file `%s` does not have a `.md` extension.\n'
|
||||
MSG_MORE_INFO='The page `%s` has an outdated more info link.\n'
|
||||
MSG_PAGE_TITLE='The page `%s` has an outdated page title.\n'
|
||||
|
||||
PLATFORMS=$(ls pages/)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue