forked from api-platform/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
calavera.sh
executable file
·43 lines (31 loc) · 896 Bytes
/
calavera.sh
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
#!/bin/sh
# Cleanup previous build
rm -Rf gowrkspc/ app/doc/
# Install calavera
export GOPATH=$PWD/gowrkspc
mkdir -p gowrkspc/src/github.com/dunglas
cd gowrkspc/src/github.com/dunglas
git clone git@github.com:dunglas/calavera.git
cd calavera
go get
go install
# Clone the doc
cd $GOPATH/..
mkdir app/doc
cd app/doc
git clone -b 1.0 git@github.com:api-platform/doc.git 1.0
cd 1.0
# Generate JSON-LD files
$GOPATH/bin/calavera . .
# Generate symlinks
find . -name "*.jsonld" -type f | while read NAME ; do ln -sf `python -c "import os.path; print os.path.relpath('../../index.html', '${NAME}/..')"` "${NAME%.jsonld}.html" ; done
cd $GOPATH/../app
ln -s index.html download.html
ln -s index.html doc.html
ln -s index.html news.html
ln -s index.html support.html
ln -s index.html demo.html
ln -s index.html news.html
ln -s ../index.html doc/index.html
# Cleanup Go stuffes
rm -Rf $GOPATH