File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Copy docs to material docs site
4
+
5
+ # Run this script after `gulp docs`
6
+ # Need to specify destination folder
7
+ # Use OVERVIEW.html when possible. If there's no OVERVIEW file exists, use README.html
8
+
9
+ usage=' Usage: copy-docs.sh $destinationFolder'
10
+ if [ $# -ne 1 ]; then
11
+ echo " Missing destination folder. $usage "
12
+ exit
13
+ fi
14
+
15
+ originFolder=./dist/docs/
16
+ destFolder=$1
17
+
18
+ if [ ! -w $destFolder ]; then
19
+ echo " Invalid destination folder. $usage "
20
+ exit
21
+ fi
22
+
23
+ for file in $originFolder *
24
+ do
25
+ name=${file# $originFolder }
26
+ overviewFile=$originFolder$name /OVERVIEW.html
27
+ readmeFile=$originFolder$name /README.html
28
+ destFile=$destFolder /$name .html
29
+ if [ -f $overviewFile ]; then
30
+ cp $overviewFile $destFile
31
+ echo " Copied $overviewFile to $destFile "
32
+ elif [ -f $readmeFile ]; then
33
+ cp $readmeFile $destFile
34
+ echo " Copied $readmeFile to $destFile "
35
+ fi
36
+ done
You can’t perform that action at this time.
0 commit comments