forked from GuanceCloud/datakit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyuque.sh
executable file
·68 lines (54 loc) · 1.41 KB
/
yuque.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# Install waque:
# $ npm i -g waque
# $ waque login # 此处会弹出浏览器,确认雨雀登陆
##################
# colors
##################
RED="\033[31m"
GREEN="\033[32m"
YELLOW="\033[33m"
CLR="\033[0m"
docs_dir=~/git/dataflux-doc/docs/datakit
integration_docs_dir=~/git/dataflux-doc/docs/integrations
mkdir -p $docs_dir $integration_docs_dir
cp man/summary.md .docs/
latest_tag=$(git tag --sort=-creatordate | head -n 1)
current_branch=$(git rev-parse --abbrev-ref HEAD)
man_version=$1
if [ -z $man_version ]; then
printf "${YELLOW}[W] manual version missing, use current tag %s as version${CLR}\n" $latest_tag
man_version="${latest_tag}"
fi
waque_yml="yuque.yml"
case $current_branch in
"yuque") ;;
# pass
"yuque-github-mirror")
waque_yml="yuque_community.yml"
printf "${GREEN}[I] current branch is %s, use %s ${CLR}\n" $current_branch $waque_yml
;;
*)
waque_yml="yuque_testing.yml"
printf "${GREEN}[I] current branch is %s, use %s ${CLR}\n" $current_branch $waque_yml
;;
esac
os=
if [[ "$OSTYPE" == "darwin"* ]]; then
os="darwin"
else
os="linux"
fi
make
echo 'export to datakit docs...'
dist/datakit-${os}-amd64/datakit doc \
--export-docs $docs_dir \
--ignore demo \
--version "${man_version}" \
--TODO "-"
echo 'export to integrations docs...'
dist/datakit-${os}-amd64/datakit doc \
--export-docs $integration_docs_dir \
--ignore demo \
--version "${man_version}" \
--TODO "-"