Skip to content

Commit

Permalink
Updated doc gen script.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Cobbe committed Sep 19, 2017
1 parent 8177eb4 commit 229819b
Showing 1 changed file with 26 additions and 20 deletions.
46 changes: 26 additions & 20 deletions Format/generate_docs.sh
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

0 comments on commit 229819b

Please sign in to comment.