Merge pull request #271 from danvk/connect-separated-points
[dygraphs.git] / push-to-web.sh
... / ...
CommitLineData
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.
4
5if [ "$1" == "" ] ; then
6 echo "usage: $0 destination"
7 exit 1
8fi
9
10set -x
11site=$1
12
13# Produce dygraph-combined.js.
14./generate-combined.sh
15
16# Generate documentation.
17./generate-documentation.py > docs/options.html
18chmod a+r docs/options.html
19if [ -s docs/options.html ] ; then
20 ./generate-jsdoc.sh
21 ./generate-download.py > docs/download.html
22
23 temp_dir=$(mktemp -d /tmp/dygraphs-docs.XXXX)
24 cd docs
25 ./ssi_expander.py $temp_dir
26 cd ..
27
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
32 # Copy everything to the site.
33 rsync -avzr gallery strftime rgbcolor common tests jsdoc experimental plugins $site \
34 && \
35 rsync -avzr --copy-links dashed-canvas.js stacktrace.js dygraph*.js gadget.xml excanvas.js thumbnail.png screenshot.png $temp_dir/* $site/
36else
37 echo "generate-documentation.py failed"
38fi
39
40# Revert changes to dygraph-combined.js and docs.
41git checkout dygraph-combined.js
42git checkout docs/download.html
43rm docs/options.html
44rm -rf $temp_dir