forked from btcpayserver/btcpayserver-doc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-deps.sh
executable file
·54 lines (43 loc) · 1.25 KB
/
setup-deps.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
#!/bin/bash
set -e
BASE_DIR=$(cd `dirname $0` && pwd)
DOCS_DIR=$BASE_DIR/docs
PUBLIC_DIR=$DOCS_DIR/.vuepress/public
DOCKER_DIR=$BASE_DIR/deps/docker
TRANSMUTER_DIR=$BASE_DIR/deps/transmuter
update_external() {
sed -ie 's*(https://github.com/btcpayserver/btcpayserver-doc/blob/master/*(../*g' $1
sed -ie 's*(https://github.com/btcpayserver/btcpayserver-doc/raw/master/*(../*g' $1
sed -ie '1s*^*---\
editLink: false\
---\
*' $1
}
# Docker
rm -rf $DOCS_DIR/Docker
mkdir -p $DOCS_DIR/Docker
if [ ! -d $DOCKER_DIR ]; then
git clone https://github.com/btcpayserver/btcpayserver-docker.git $DOCKER_DIR
else
cd $DOCKER_DIR && git checkout master && git pull
fi
cd $DOCKER_DIR
cp -r README.md docs/* $DOCS_DIR/Docker
sed -ie 's$(docs/$(./$g' $DOCS_DIR/Docker/README.md
for file in $DOCS_DIR/Docker/*.md; do
update_external $file
done
# Transmuter
rm -rf $DOCS_DIR/Transmuter
mkdir -p $DOCS_DIR/Transmuter
if [ ! -d $TRANSMUTER_DIR ]; then
git clone https://github.com/btcpayserver/btcTransmuter.git $TRANSMUTER_DIR
else
cd $TRANSMUTER_DIR && git checkout master && git pull
fi
cd $TRANSMUTER_DIR
cp -r README.md docs/* $DOCS_DIR/Transmuter
sed -ie 's$(docs/$(./$g' $DOCS_DIR/Transmuter/README.md
for file in $DOCS_DIR/Transmuter/*.md; do
update_external $file
done