Skip to content

Commit c6a3966

Browse files
authoredOct 3, 2023
docs: Generate API documentation for release branch (parse-community#2035)
1 parent 74ff091 commit c6a3966

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed
 

‎release_docs.sh

+16-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
#!/bin/sh -e
22
set -x
3+
# GITHUB_ACTIONS=true SOURCE_TAG=test ./release_docs.sh
4+
35
if [ "${GITHUB_ACTIONS}" = "" ];
46
then
57
echo "Cannot release docs without GITHUB_ACTIONS set"
68
exit 0;
79
fi
10+
if [ "${SOURCE_TAG}" = "" ];
11+
then
12+
echo "Cannot release docs without SOURCE_TAG set"
13+
exit 0;
14+
fi
815
REPO="https://github.com/parse-community/Parse-SDK-JS"
916

1017
rm -rf docs
@@ -13,16 +20,16 @@ cd docs
1320
git pull origin gh-pages
1421
cd ..
1522

16-
DEST="master"
23+
RELEASE="release"
24+
VERSION="${SOURCE_TAG}"
1725

18-
if [ "${SOURCE_TAG}" != "" ];
19-
then
20-
DEST="${SOURCE_TAG}"
21-
# change the default page to the latest
22-
echo "<meta http-equiv='refresh' content='0; url=/Parse-SDK-JS/api/${DEST}'>" > "docs/api/index.html"
23-
fi
26+
# change the default page to the latest
27+
echo "<meta http-equiv='refresh' content='0; url=/Parse-SDK-JS/api/${VERSION}'>" > "docs/api/index.html"
2428

2529
npm run docs
2630

27-
mkdir -p "docs/api/${DEST}"
28-
cp -R out/* "docs/api/${DEST}"
31+
mkdir -p "docs/api/${RELEASE}"
32+
cp -R out/* "docs/api/${RELEASE}"
33+
34+
mkdir -p "docs/api/${VERSION}"
35+
cp -R out/* "docs/api/${VERSION}"

0 commit comments

Comments
 (0)
Please sign in to comment.