diff options
author | Ryota MIBU <r-mibu@cq.jp.nec.com> | 2015-12-22 14:27:34 +0900 |
---|---|---|
committer | Ryota MIBU <r-mibu@cq.jp.nec.com> | 2015-12-22 14:27:34 +0900 |
commit | 9c1669b0db7698f67da9346bc2d93e0205ba1ecc (patch) | |
tree | 0d1670f5b920bd3652c387fe098a8e72cb118ff6 | |
parent | 582f7d9fcd0d780fd8be8d8b5cceb823d4ed6d35 (diff) |
fix docs-build.sh bug in rst checks
After [1] merged, docs-build.sh cannot check and edit rst files to
add revision into source files. Build error can be found in [2].
This patch fixes this bug.
[1] https://gerrit.opnfv.org/gerrit/#/c/4659
[2] https://build.opnfv.org/ci/job/opnfv-docs-verify-master/211/console
Change-Id: I506d85341d665a1e2c854ab5965ef3abffa31446
Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
-rwxr-xr-x | utils/docs-build.sh | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/utils/docs-build.sh b/utils/docs-build.sh index 99c5aea86..af31d7a39 100755 --- a/utils/docs-build.sh +++ b/utils/docs-build.sh @@ -61,15 +61,18 @@ function check_rst_doc() { function add_html_notes() { _src="$1" - if grep -e ' _sha1_' "$_src"/*.rst ; then - # TODO: remove this, once old templates were removed from all repos. - echo - echo "Warn: '_sha1_' was found, use the latest document template." - echo " See https://wiki.opnfv.org/documentation/tools ." - echo - sed -i "s/ _sha1_/ $git_sha1/g" "$_src"/*.rst - fi - sed -i -e "\$a\\\n.. only:: html\n$html_notes" "$_src"/*.rst + find "$_src" -name '*.rst' | while read file + do + if grep -q -e ' _sha1_' "$file" ; then + # TODO: remove this, once old templates were removed from all repos. + echo + echo "Warn: '_sha1_' was found in [$file], use the latest document template." + echo " See https://wiki.opnfv.org/documentation/tools ." + echo + sed -i "s/ _sha1_/ $git_sha1/g" "$file" + fi + sed -i -e "\$a\\\n.. only:: html\n$html_notes" "$file" + done } function prepare_src_files() { |