diff --git a/gendoc.sh b/gendoc.sh index 8525e8d..b63160d 100644 --- a/gendoc.sh +++ b/gendoc.sh @@ -43,9 +43,9 @@ pushd $HOME > /dev/null link=`readlink ".appledoc"` if [[ $link != "" ]]; then -cd $link + cd $link else -cd ".appledoc" + cd ".appledoc" fi templates=`pwd` popd > /dev/null @@ -61,7 +61,7 @@ githubuser=${BASH_REMATCH[2]} # if we're on the documentation branch, something's gone wrong if [[ "$codebranch" == "gh-pages" ]] then -echo "You seem to be on the gh-pages branch. Checkout a code branch instead." + echo "You seem to be on the gh-pages branch. Checkout a code branch instead." exit 1 fi @@ -73,41 +73,41 @@ mkdir -p -v "$tempdir" # include settings file if it's present if [ -e ./.appledoc.plist ]; then -echo "Found appledoc settings file" -settings=./.appledoc.plist + echo "Found appledoc settings file" + settings=./.appledoc.plist fi # generate docset and html, install docset in xcode, create atom feed and downloadable package appledoc \ ---templates "$templates" \ ---keep-intermediate-files \ ---create-html \ ---create-docset \ ---install-docset \ ---publish-docset \ ---docsetutil-path "$docsetutil" \ ---docset-atom-filename "docset.atom" \ ---docset-feed-url "http://$githubuser.github.com/$projectname/$docdirectory/%DOCSETATOMFILENAME" \ ---docset-package-url "http://$githubuser.github.com/$projectname/$docdirectory/%DOCSETPACKAGEFILENAME" \ ---docset-fallback-url "http://$githubuser.github.com/projectname/$docdirectory/" \ ---project-name $projectname \ --o "$tempdir" "$@" $settings ./ + --templates "$templates" \ + --keep-intermediate-files \ + --create-html \ + --create-docset \ + --install-docset \ + --publish-docset \ + --docsetutil-path "$docsetutil" \ + --docset-atom-filename "docset.atom" \ + --docset-feed-url "http://$githubuser.github.com/$projectname/$docdirectory/%DOCSETATOMFILENAME" \ + --docset-package-url "http://$githubuser.github.com/$projectname/$docdirectory/%DOCSETPACKAGEFILENAME" \ + --docset-fallback-url "http://$githubuser.github.com/projectname/$docdirectory/" \ + --project-name $projectname \ + -o "$tempdir" "$@" $settings ./ # clone doc branch of current repo into temporary location $git clone "$originaldirectory" "$tempdir/branch" if $git show-ref --tags --quiet --verify -- "refs/heads/$docbranch" then -pushd "$tempdir/branch" > /dev/null -echo "Checking out $docbranch branch" -$git checkout $docbranch + pushd "$tempdir/branch" > /dev/null + echo "Checking out $docbranch branch" + $git checkout $docbranch else -pushd "$tempdir/branch" > /dev/null -echo "Creating $docbranch branch" -defaultcommitmessage=$initialdefaultcommitmessage -$git symbolic-ref HEAD "refs/heads/$docbranch" -rm .git/index -$git clean -fdx + pushd "$tempdir/branch" > /dev/null + echo "Creating $docbranch branch" + defaultcommitmessage=$initialdefaultcommitmessage + $git symbolic-ref HEAD "refs/heads/$docbranch" + rm .git/index + $git clean -fdx fi # make sure stale docs are removed - re-adding will cause an update @@ -121,9 +121,9 @@ mv -v ../publish/* "$docdirectory" # add directory and commit with default message $git add -f -v "$docdirectory" if $editcommit; then -$git commit -e -m "$defaultcommitmessage" + $git commit -e -m "$defaultcommitmessage" else -$git commit -m "$defaultcommitmessage" + $git commit -m "$defaultcommitmessage" fi # push changes back to our repo @@ -136,10 +136,10 @@ popd > /dev/null # if publishing is on, push the documentation pages, otherwise echo out the command that would push them if $publish ; then -git push $githubrepo $docbranch:$docbranch + git push $githubrepo $docbranch:$docbranch else -echo "To push the documentation changes, do:" -echo "git push $githubrepo $docbranch:$docbranch" + echo "To push the documentation changes, do:" + echo "git push $githubrepo $docbranch:$docbranch" fi # echo info on the location of the feed @@ -148,6 +148,6 @@ echo "Documentation changes may take a while to filter through..." # open the top of the documentation pages in the browser if $open ; then -open "http://$githubuser.github.com/$projectname/$docdirectory" + open "http://$githubuser.github.com/$projectname/$docdirectory" fi