@@ -8,6 +8,7 @@ cd "$(dirname $0)/../../"
8
8
docsPath=" /dist/docs"
9
9
repoPath=" /tmp/material2-docs-content"
10
10
repoUrl=" https://github.com/DevVersion/material2-docs-content"
11
+ examplesSource=" /dist/docs/examples"
11
12
12
13
# If the docs directory is not present, generate docs
13
14
if [ ! -d $docsPath ]; then
@@ -21,47 +22,46 @@ commitAuthorEmail="$(git --no-pager show -s --format='%ae' HEAD)"
21
22
commitMessage=" $( git log --oneline -n 1) "
22
23
23
24
# create directory and clone test repo
24
- rm -rf " /tmp/"
25
- mkdir " /tmp/ " $repoPath
25
+ rm -rf /tmp/
26
+ mkdir -p $repoPath
26
27
git clone $repoUrl $repoPath
27
28
28
29
# Clean out repo directory and copy contents of dist/docs into it
29
30
rm -rf $repoPath /*
30
31
mkdir $repoPath /overview
31
32
mkdir $repoPath /guides
32
33
mkdir $repoPath /api
33
- # mkdir $repoPath/examples
34
+ mkdir $repoPath /examples
34
35
35
36
# Move api files over to $repoPath/api
36
37
cp -r $docsPath /api/* $repoPath /api
37
38
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
-
46
39
# Flatten the markdown docs structure and move it into $repoPath/overview
47
40
overviewFiles=$docsPath /markdown/
48
- targetFile=" OVERVIEW.html"
49
41
for filename in $overviewFiles *
50
42
do
51
43
if [ -d $filename ]; then
52
44
for _ in $filename /*
53
45
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/
58
50
fi
59
51
done
60
52
fi
61
53
done
62
54
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
65
65
66
66
# Push content to repo
67
67
cd $repoPath
0 commit comments