forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocs.sh
executable file
·46 lines (34 loc) · 979 Bytes
/
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
42
43
44
45
46
#!/bin/bash
ARG_DEFS=(
"--version-name=(.*)"
)
echo "##### "
echo "##### site/docs.sh"
echo "#####"
function init {
SITE_DIR=$HOME/ionic-site
../clone/clone.sh --repository="driftyco/ionic-site" \
--directory="$SITE_DIR" \
--branch="master"
}
# Example: ./scripts/site/publish.sh --action=docs --version-name=nightly
function run {
cd ../..
VERSION=$(readJsonProp "package.json" "version")
node_modules/.bin/gulp docs --doc-version="$VERSION_NAME" --dist=$SITE_DIR
node_modules/.bin/gulp docs-index --dist=$SITE_DIR
cd $SITE_DIR
npm install
CHANGES=$(git status --porcelain)
# if no changes, don't commit
if [[ "$CHANGES" == "" ]]; then
echo "-- No changes detected in docs for $VERSION_NAME; docs not updated."
else
git add -A
git commit -am "docs: update for $VERSION"
git push -q origin master
source deploy.sh
echo "-- Updated docs for $VERSION_NAME succesfully!"
fi
}
source $(dirname $0)/../utils.inc