-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stephen Cobbe
committed
Sep 19, 2017
1 parent
8177eb4
commit 229819b
Showing
1 changed file
with
26 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,38 @@ | ||
# Script for generating jazzy docs | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "Script requires version number argument" | ||
if [ "$#" -ne 3 ]; then | ||
echo "Script requires three arguments: 1. version number and 2. path to docs repo checkout 3. path to updated SDK checkout." | ||
else | ||
sdk_version="$1" | ||
|
||
base_location="../../docs/api-docs" | ||
docs_repo_location="$2" | ||
sdk_repo_location="$3" | ||
|
||
echo "Checking doc repo exists..." | ||
|
||
if [ -d $base_location ]; then | ||
docs_location="$base_location/$sdk_version" | ||
if [ -d $docs_location ]; then | ||
rm -rf $docs_location | ||
fi | ||
|
||
mkdir $docs_location | ||
if [ -d $docs_repo_location ]; then | ||
if [ -d $sdk_repo_location ]; then | ||
docs_location="$docs_repo_location/api-docs/$sdk_version" | ||
if [ -d $docs_location ]; then | ||
rm -rf $docs_location | ||
fi | ||
|
||
mkdir $docs_location | ||
|
||
echo "Generating documents..." | ||
cd ../Source/SwiftyDropbox | ||
jazzy --readme ../../README.md --config ../../.jazzy.json --github_url https://github.com/dropbox/SwiftyDropbox --module-version 4.0.4 --module SwiftyDropbox -o ../../Format/$docs_location | ||
cd - | ||
echo "Generating documents..." | ||
cd ../Source/SwiftyDropbox | ||
jazzy --readme $sdk_repo_location/README.md --config $sdk_repo_location/.jazzy.json --github_url https://github.com/dropbox/SwiftyDropbox --module-version $sdk_version --module SwiftyDropbox -o $docs_location | ||
cd - | ||
|
||
cd $base_location/ | ||
rm latest | ||
ln -s $sdk_version latest | ||
cd - | ||
cd $docs_repo_location/api-docs | ||
rm latest | ||
ln -s $sdk_version latest | ||
cd - | ||
|
||
echo "Finished generating docs to: $docs_repo_location/api-docs." | ||
else | ||
echo "SDK directory does not exist" | ||
fi | ||
else | ||
echo "Docs directory does not exist" | ||
fi | ||
fi | ||
fi |