forked from vicentllongo/simplecov-json
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate_docs.sh
executable file
·37 lines (26 loc) · 839 Bytes
/
update_docs.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
#!/usr/bin/env bash
git checkout master
git fetch
stash_created=0
if [[ "$(git diff --stat)" != "" ]]; then
stash_created=1
git stash push -u -a -m "Before updating docs"
fi;
git pull --rebase
rake yard
git checkout gh-pages
if [[ "$(git branch | grep \* | cut -d ' ' -f2)" != "gh-pages" ]]; then
git checkout -b gh-pages
fi;
echo "Cleaning up current documentation"
find . ! -path '*/.git*' ! -path '*/doc*' ! -path '*/vendor*' ! -path '*/gemfiles*' ! -path '*/update_docs.sh*' ! -path '*/_config.yml*' ! -path '*/_index.html*' ! -path '.' | xargs rm -rf
echo "Copying new documentation"
mv doc/* ./
echo "Sending new documentation to github"
git add --all
git commit -a -m 'Update documentation'
git push --set-upstream origin gh-pages --force
if [[ $stash_created == 1 ]]; then
git stash pop
fi;
git checkout master