Skip to content

chore: Add a script to copy docs files to material docs site #2337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 22, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions scripts/release/copy-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Copy docs to material docs site

# Run this script after `gulp docs`
# Need to specify destination folder
# Use OVERVIEW.html when possible. If there's no OVERVIEW file exists, use README.html

usage='Usage: copy-docs.sh $destinationFolder'
if [ $# -ne 1 ]; then
echo "Missing destination folder. $usage"
exit
fi

originFolder=./dist/docs/
destFolder=$1

if [ ! -w $destFolder ]; then
echo "Invalid destination folder. $usage"
exit
fi

for file in $originFolder*
do
name=${file#$originFolder}
overviewFile=$originFolder$name/OVERVIEW.html
readmeFile=$originFolder$name/README.html
destFile=$destFolder/$name.html
if [ -f $overviewFile ]; then
cp $overviewFile $destFile
echo "Copied $overviewFile to $destFile"
elif [ -f $readmeFile ]; then
cp $readmeFile $destFile
echo "Copied $readmeFile to $destFile"
fi
done