Skip to content

Commit a623ff0

Browse files
authored
Merge pull request #1102 from vim-jp/support-displaying-deleted-files
Support displaying deleted files
2 parents 3708ab1 + ae73211 commit a623ff0

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

tools/script/get_doc_info.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ old_doc_dir=${GITHUB_WORKSPACE}/work/en
1212
# 出力ファイル名
1313
outf=doc_info.md
1414
rm -f ${outf}
15+
rm -f ${outf}.presort
1516

1617
# 除外ファイル
1718
exclude_files_str='
@@ -40,7 +41,6 @@ echo -n "|:---" >> ${outf}
4041
echo -n "|:---" >> ${outf}
4142
echo "|" >> ${outf}
4243

43-
4444
for fp in `ls -1 ${new_doc_dir}/*.txt`; do
4545
fname=`basename ${fp}`
4646
old_fp=${old_doc_dir}/${fname}
@@ -86,10 +86,29 @@ for fp in `ls -1 ${new_doc_dir}/*.txt`; do
8686
lines+=("|")
8787
if ${is_output}; then
8888
line="$(IFS=; echo "${lines[*]}")"
89-
echo ${line[@]} >> ${outf}
89+
echo ${line[@]} >> ${outf}.presort
9090
fi
9191
done
9292

93+
# Detect deleted files.
94+
for fp in `ls -1 ${old_doc_dir}/*.txt`; do
95+
fname=`basename ${fp}`
96+
new_fp=${new_doc_dir}/${fname}
97+
98+
lines=()
99+
if [ ! -e ${new_fp} ]; then
100+
lines+=("|${fname}")
101+
set `wc -l ${fp}`
102+
lines+=("|${1}")
103+
lines+=("|Deleted||||")
104+
line="$(IFS=; echo "${lines[*]}")"
105+
echo ${line[@]} >> ${outf}.presort
106+
fi
107+
done
108+
109+
sort ${outf}.presort >> ${outf}
110+
rm -f ${outf}.presort
111+
93112
echo "" >> ${outf}
94113
echo "更新不要の ${unchanged_file_count} ファイルの表示は省略しています。" >> ${outf}
95114

0 commit comments

Comments
 (0)