forked from nodeshift/opossum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish-docs.sh
executable file
·41 lines (35 loc) · 897 Bytes
/
publish-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
38
39
40
41
#!/bin/bash
PUBLISH_DIR="publish"
VERSION="0.14.0"
echo $1
git status -s | grep "^[MADRCU\? ][ MDMAU\?]"
if [[ $? -eq 0 && "$1" != "-f" ]]; then
echo "You have changes in your working directory. Take care of that first, 'k?"
echo "Override this, with the '-f' flag."
exit 1;
fi
while true; do
read -p "This will publish the API docs. Continue? [Y/n] " yn
case $yn in
[Nn]* ) echo "Aborting."; exit;;
* ) echo "Continuing."; break;;
esac
done
npm run build:docs
git clone [email protected]:bucharest-gold/opossum.git $PUBLISH_DIR
cd $PUBLISH_DIR
git checkout gh-pages
mkdir $VERSION
rsync -r ../docs/* ./
rsync -r ../docs/* ./$VERSION/
git status -s | grep "^[MADRCU\? ][ MDMAU\?]"
if [ $? -eq 0 ]; then
git add .
echo "Commiting and publishing"
git commit -a -m "Update docs"
git push origin gh-pages
else
echo "No changes to publish"
fi
cd ..
rm -rf $PUBLISH_DIR