@@ -8,6 +8,7 @@ cd "$(dirname $0)/../../"
88docsPath=" /dist/docs"
99repoPath=" /tmp/material2-docs-content"
1010repoUrl=" https://github.com/DevVersion/material2-docs-content"
11+ examplesSource=" /dist/docs/examples"
1112
1213# If the docs directory is not present, generate docs
1314if [ ! -d $docsPath ]; then
@@ -21,47 +22,46 @@ commitAuthorEmail="$(git --no-pager show -s --format='%ae' HEAD)"
2122commitMessage=" $( git log --oneline -n 1) "
2223
2324# create directory and clone test repo
24- rm -rf " /tmp/"
25- mkdir " /tmp/ " $repoPath
25+ rm -rf /tmp/
26+ mkdir -p $repoPath
2627git clone $repoUrl $repoPath
2728
2829# Clean out repo directory and copy contents of dist/docs into it
2930rm -rf $repoPath /*
3031mkdir $repoPath /overview
3132mkdir $repoPath /guides
3233mkdir $repoPath /api
33- # mkdir $repoPath/examples
34+ mkdir $repoPath /examples
3435
3536# Move api files over to $repoPath/api
3637cp -r $docsPath /api/* $repoPath /api
3738
38- # Move guide files over to $repoPath/guides
39- for filename in $overviewFiles *
40- do
41- if [ -f $filename ]; then
42- cp -r $filename $repoPath /guides
43- fi
44- done
45-
4639# Flatten the markdown docs structure and move it into $repoPath/overview
4740overviewFiles=$docsPath /markdown/
48- targetFile=" OVERVIEW.html"
4941for filename in $overviewFiles *
5042do
5143 if [ -d $filename ]; then
5244 for _ in $filename /*
5345 do
54- if [ -f $ filename/ $targetFile ] ; then
55- name= ${filename # $overviewFiles }
56- cp -r $filename /$targetFile $repoPath /overview/
57- mv $repoPath /overview/ $targetFile $repoPath /overview/$name .html
46+ markdownFile= ${ filename# $overviewFiles } .html
47+ # Filename should be same as folder name with .html extension
48+ if [ -e $filename /$markdownFile ] ; then
49+ cp -r $filename / $markdownFile $repoPath /overview/
5850 fi
5951 done
6052 fi
6153done
6254
63- # src/examples should be added to the $repoPath after they have been moved into
64- # the material2 repo from material.angular.io
55+ # Move guide files over to $repoPath/guides
56+ for filename in $overviewFiles *
57+ do
58+ if [ -f $filename ]; then
59+ cp -r $filename $repoPath /guides
60+ fi
61+ done
62+
63+ # Move highlighted examples into $repoPath
64+ cp -r $examplesSource /* $repoPath /examples
6565
6666# Push content to repo
6767cd $repoPath
0 commit comments