forked from tayloraswift/swift-png
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate-documentation
executable file
·63 lines (53 loc) · 1.27 KB
/
generate-documentation
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
TOOL_NAME=$0
usage()
{
echo "usage: $TOOL_NAME [OPTION...]
-l, --local generate local html pages (as opposed to a deployable website)"
}
error()
{
echo $1
exit 1
}
check()
{
message=$1
shift
echo $@
"$@" || error "$message"
}
local=
while [ "$1" != "" ] ; do
case $1 in
-l | --local )
shift
local="local"
;;
* )
usage
exit 1
esac
shift
done
base=$PWD
mkdir -p .entrapta/
cd .entrapta/
if ! [ -d entrapta ]; then
git clone https://github.com/kelvin13/entrapta
else
cd entrapta
git pull
cd ..
fi
cd entrapta/
# lock to version 0.1.0
git checkout tags/0.1.0
check "failed to build entrapta" \
swift build -c release
if [ -z $local ]; then
.build/release/entrapta ../../sources/png/*.swift --directory ../../documentation/ --url-prefix https://kelvin13.github.io/swift-png --github https://github.com/kelvin13/swift-png --project Swift\ PNG\ Documentation --theme eternia
else
.build/release/entrapta ../../sources/png/*.swift --directory ../../documentation/ --url-prefix $base/documentation --url-suffix /index.html --github https://github.com/kelvin13/swift-png --project Swift\ PNG\ Documentation --theme eternia
fi
cd ../../