forked from uriparser/uriparser.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync-api-docs.sh
More file actions
executable file
·40 lines (32 loc) · 1019 Bytes
/
sync-api-docs.sh
File metadata and controls
executable file
·40 lines (32 loc) · 1019 Bytes
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
#! /usr/bin/env bash
# Copyright (C) 2018 Sebastian Pipping <sebastian@pipping.org>
# Licensed under the MIT license
require_clean_git() {
git diff --quiet || exit 1
git diff --cached --quiet || exit 1
}
PS4='# '
set -x
set -e
abstargetdir="$(dirname "$0")"/doc/api/latest
[[ ${abstargetdir:0:1} != / ]] && abstargetdir="${PWD}/${abstargetdir}"
require_clean_git
[[ -d "${abstargetdir}" ]] && git rm -r "${abstargetdir}"
# Build fresh docs from uriparser Git master
abstempdir="$(mktemp -d)"
absversionfile="$(mktemp)"
(
cd "${abstempdir}"
git clone https://github.com/uriparser/uriparser.git
cd uriparser
git describe --tags | sed 's,^uriparser-,,' > "${absversionfile}"
./autogen.sh
./configure --disable-test
make -C doc
)
./optimize-png-files.sh "${abstempdir}"
mkdir "$(dirname "${abstargetdir}")"
mv "${abstempdir}"/uriparser/doc/html "${abstargetdir}"
rm -Rf "${abstempdir}"
git add "${abstargetdir}"
git ci -m "API docs: Update to version $(cat "${absversionfile}")"