Commit | Line | Data |
---|---|---|
ff533c10 DV |
1 | #!/bin/bash |
2 | # This script generates the combined JS file, pushes all content to a web site | |
3 | # and then reverts the combined file. | |
5f303314 RK |
4 | |
5 | if [ "$1" == "" ] ; then | |
cf88e0ec | 6 | echo "usage: $0 destination" |
5f303314 RK |
7 | exit 1 |
8 | fi | |
9 | ||
11a25550 | 10 | set -x |
ff533c10 | 11 | site=$1 |
c9093b7b | 12 | |
ff533c10 DV |
13 | # Produce dygraph-combined.js. |
14 | ./generate-combined.sh | |
15 | ||
d3454ce4 | 16 | # Generate documentation. |
817b08dd | 17 | ./generate-documentation.py > docs/options.html |
b7d36956 | 18 | chmod a+r docs/options.html |
aade5c60 RK |
19 | if [ -s docs/options.html ] ; then |
20 | ./generate-jsdoc.sh | |
5c364f57 | 21 | ./generate-download.py > docs/download.html |
d3454ce4 | 22 | |
14403441 DV |
23 | temp_dir=$(mktemp -d /tmp/dygraphs-docs.XXXX) |
24 | cd docs | |
25 | ./ssi_expander.py $temp_dir | |
26 | cd .. | |
27 | ||
c9093b7b DV |
28 | # Make sure everything will be readable on the web. |
29 | # This is like "chmod -R a+rX", but excludes the .git directory. | |
30 | find . -path ./.git -prune -o -print | xargs chmod a+rX | |
31 | ||
aade5c60 | 32 | # Copy everything to the site. |
b7a1dc22 | 33 | rsync -avzr gallery common tests jsdoc experimental plugins $site \ |
aade5c60 | 34 | && \ |
14403441 | 35 | rsync -avzr --copy-links dashed-canvas.js stacktrace.js dygraph*.js gadget.xml excanvas.js thumbnail.png screenshot.png $temp_dir/* $site/ |
aade5c60 RK |
36 | else |
37 | echo "generate-documentation.py failed" | |
38 | fi | |
ff533c10 | 39 | |
5c364f57 | 40 | # Revert changes to dygraph-combined.js and docs. |
fccae3c0 | 41 | git checkout dygraph-combined.js |
5c364f57 | 42 | git checkout docs/download.html |
d3454ce4 | 43 | rm docs/options.html |
14403441 | 44 | rm -rf $temp_dir |