docs-build.sh: fix merging of top level docs 11/5711/4
authorRyota MIBU <r-mibu@cq.jp.nec.com>
Thu, 7 Jan 2016 02:55:45 +0000 (11:55 +0900)
committerRyota Mibu <r-mibu@cq.jp.nec.com>
Thu, 7 Jan 2016 09:09:16 +0000 (09:09 +0000)
Change-Id: I6d489be3631fa81e799b55cce9d9e3d1c2608140
Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
utils/docs-build.sh

index e5e6025..914eaf2 100755 (executable)
@@ -180,7 +180,16 @@ do
     }
 
     if is_top_dir "$dir" ; then
-        mv "$output"/* "$OUTPUT_DIR"/
+        # NOTE: Having top level document (docs/index.rst) is not recommended.
+        #       It may cause conflicts with other docs (mostly with HTML
+        #       folders for contents in top level docs and other document
+        #       folders). But, let's try merge of those contents into the top
+        #       docs directory.
+        (
+            cd $output
+            find . -type d -print | xargs -I d mkdir -p ../d
+            find . -type f -print | xargs -I f mv -b f ../f
+        )
         rm -rf "$output"
     fi