File: RefreshOnlineDocs.sh

package info (click to toggle)
sbjson 2.3.2-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 776 kB
  • sloc: objc: 1,035; sh: 73; makefile: 10
file content (44 lines) | stat: -rwxr-xr-x 779 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh

set -x

DOCSET=$INSTALL_DIR/Docset/html
VERSION=$(agvtool mvers -terse1 | perl -pe 's/(\d\.\d+)(\.\d+)*/$1/')

apidir=$VERSION
latest=api

if ! test -f "$DOCSET/index.html" ; then
    echo "$dir does not contain index.html"
    exit 1
fi


status=$(git status -s)
if ! test -z $status ; then
    echo "Checkout has uncommitted changes"
    exit 1
fi

tmp=$(basename $0)
tmpdir=$(mktemp -d "/tmp/$tmp.XXXXXX")

cp -R $DOCSET/ $tmpdir

rm -rf $tmpdir/org.brautaset.JSON.docset
rm -f $tmpdir/Makefile
rm -f $tmpdir/*.xml
rm -f $tmpdir/*.plist

branch=$(git branch | awk '$1 == "*" { print $2 }' )
git checkout gh-pages

rm -f $latest
rm -rf $apidir
mv $tmpdir $apidir
ln -s $apidir $latest

git add -A
git commit -m "refresh api docs for v$VERSION"
git checkout $branch