forked from codeigniter4/CodeIgniter4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapibot
executable file
·42 lines (35 loc) · 845 Bytes
/
apibot
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
#!/bin/bash
# Rebuild and deploy CodeIgniter4 under-development user guide
#
# This is a quick way to test user guide changes, and if they
# look good, to push them to the gh-pages branch of the
# development repository.
#
# This is not meant for updating the "stable" user guide.
UPSTREAM=https://github.com/codeigniter4/api.git
# Prepare the nested repo clone folder
rm -rf build/api*
mkdir -p build/api/docs
# Get ready for git
cd build/api
git init
git remote add origin $UPSTREAM
git fetch
git checkout master
git reset --hard origin/master
rm -r docs/*
# Make the new user guide
cd ../..
phpdoc
cp -R api/build/* build/api/docs
# All done?
if [ $# -lt 1 ]; then
exit 0
fi
# Optionally update the remote repo
if [ $1 = "deploy" ]; then
cd build/api
git add .
git commit -S -m "APIbot synching"
git push -f origin master
fi