-
Notifications
You must be signed in to change notification settings - Fork 0
/
push_docs
executable file
·45 lines (34 loc) · 722 Bytes
/
push_docs
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
#!/usr/bin/bash
# Make doc
cargo clean
cargo doc --no-deps
# Make temporary folder
rm -rf .doc_tmp
mkdir .doc_tmp
cd .doc_tmp
# initialize git repository
git init
# add remote
git remote add origin [email protected]:stefan-k/shepplogan-rs.git
# checkout gh-pages
git checkout -b gh-pages
# pull stuff
git pull origin gh-pages
# cleanup old stuff
rm -rf *
# copy documentation
cp -r ../target/doc/* .
touch .nojekyll
cat <<EOF > index.html
<!doctype html>
<meta http-equiv="refresh" content="0; ./shepplogan/">
EOF
# add and commit all
git add -f --all .
git add -f --all .*
git commit -m 'Semiautomatic update of documentation'
# push
git push -f origin gh-pages
# remove temporary directory
cd ..
rm -rf .doc_tmp