# HG changeset patch
# User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
# Date 1594992800 -7200
#      Fri Jul 17 15:33:20 2020 +0200
# Node ID 15895d32a3f842c6002c22c8d6ac795d7a105599
# Parent  fdd20e0d6faf44c1763c2e6c55f36fb4bc84970c
📝 copy doc from language aware module too

diff --git a/create_documentation b/create_documentation
--- a/create_documentation
+++ b/create_documentation
@@ -67,14 +67,22 @@
                 has_doc=True
                 echo ${YELLOW}INFO ${RESET} - Makefile found in $dir/$module_path/$doc_dir
                 pushd $doc_dir
-                # TODO read languages value from Makefile
+                # TODO read languages value from Makefile (at least available ones)
                 for language in $languages ; do
                     make $format LANGUAGE=${language} BUILDDIR=_build
                     if [[ $? -eq 0 ]] ; then
                         dest_dir=$out_dir/$module/$language/$branch
-                        echo ${GREEN}INFO ${RESET} - Documentation generation done for $dir/$module_path/$doc_dir, copy to $dest_dir
+                        echo ${GREEN}OK${RESET}    - Documentation generation done for $dir/$module_path/$doc_dir, copy to $dest_dir
                         mkdir -p $dest_dir
-                        cp -r _build/$format/. $dest_dir
+                        if [[ -d "_build/$format/$language" ]];
+                        then
+                            echo "${YELLOW}INFO ${RESET} - found _build/$format/$language/, copying from there"
+                            cp --archive --recursive "_build/$format/$language/." "$dest_dir"
+                        else
+                            # this is only because some modules Makefile is not up to date
+                            echo "${YELLOW}INFO ${RESET} - no _build/$format/$language/ found, copying from _build/$format/"
+                            cp --archive --recursive "_build/$format/." "$dest_dir"
+                        fi
                     else
                         echo ${RED}ERROR${RESET} - Documentation generation failed for $dir/$module_path/$doc_dir
                         ((module_error++))