Skip to content

Commit 98be336

Browse files
committed
commit-docs.sh outputs to docs folder
1 parent ea6bc32 commit 98be336

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

scripts/commit-docs.sh

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,19 @@
22

33
set -eux
44

5-
FOLDER=current
6-
SUBFOLDER=${1:-}
7-
85
# stash everything that isn't in docs, store result in STASH_RESULT
9-
STASH_RESULT=$(git stash push -- ":(exclude)docs")
6+
STASH_RESULT=$(git stash -- ":(exclude)docs")
107
# get branch name
118
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
129
REVISION_HASH=$(git rev-parse HEAD)
1310

11+
mv docs _docs
1412
git checkout gh-pages
15-
if [[ -z "$SUBFOLDER" ]]; then
16-
# copy contents of docs to docs/current replacing the ones that are already there
17-
rm -rf "$FOLDER"
18-
mv docs/ "$FOLDER"/
19-
# commit
20-
git add --all "$FOLDER"
21-
else
22-
# copy contents of subfolder of docs to docs/current replacing the ones that are already there
23-
rm -rf "$FOLDER"/"$SUBFOLDER"
24-
mv docs/"$SUBFOLDER"/ "$FOLDER"/"$SUBFOLDER"
25-
# commit
26-
git add --all "$FOLDER"/"$SUBFOLDER"
27-
fi
13+
# copy contents of docs to docs/current replacing the ones that are already there
14+
rm -rf docs
15+
mv _docs/ docs/
16+
# commit
17+
git add --all docs
2818

2919
git status
3020
git commit -m "Documentation for https://github.com/adam-fowler/mqtt-nio/tree/$REVISION_HASH"

0 commit comments

Comments
 (0)