fix lint error
[dygraphs.git] / push-to-web.sh
CommitLineData
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
5if [ "$1" == "" ] ; then
cf88e0ec 6 echo "usage: $0 destination"
5f303314
RK
7 exit 1
8fi
9
11a25550 10set -x
ff533c10 11site=$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 18chmod a+r docs/options.html
aade5c60
RK
19if [ -s docs/options.html ] ; then
20 ./generate-jsdoc.sh
d3454ce4 21
14403441
DV
22 temp_dir=$(mktemp -d /tmp/dygraphs-docs.XXXX)
23 cd docs
24 ./ssi_expander.py $temp_dir
25 cd ..
26
c9093b7b
DV
27 # Make sure everything will be readable on the web.
28 # This is like "chmod -R a+rX", but excludes the .git directory.
29 find . -path ./.git -prune -o -print | xargs chmod a+rX
30
aade5c60 31 # Copy everything to the site.
38e3d209 32 rsync -avzr gallery strftime rgbcolor common tests jsdoc experimental plugins $site \
aade5c60 33 && \
14403441 34 rsync -avzr --copy-links dashed-canvas.js stacktrace.js dygraph*.js gadget.xml excanvas.js thumbnail.png screenshot.png $temp_dir/* $site/
aade5c60
RK
35else
36 echo "generate-documentation.py failed"
37fi
ff533c10 38
d3454ce4 39# Revert changes to dygraph-combined.js and docs/options.html
fccae3c0 40git checkout dygraph-combined.js
d3454ce4 41rm docs/options.html
14403441 42rm -rf $temp_dir