Make Javadoc script work again in release mode.
I broke it with `set -e` in CL 178630375 because it tries to `git rm` a directory that's normally not present.
Also, extend CL 178630375's work to make it possible to run the script again if it fails halfway through, this time by using `cp` instead of `mv`.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180932001
diff --git a/util/generate-latest-docs.sh b/util/generate-latest-docs.sh
index b8769d4..45f53d6 100755
--- a/util/generate-latest-docs.sh
+++ b/util/generate-latest-docs.sh
@@ -49,8 +49,8 @@
git config --global user.name "travis-ci"
fi
api_version_dir="${target_dir}/gh-pages/${version_subdir}"
- git rm -rf ${api_version_dir}
- mv ${target_dir}/site/apidocs ${api_version_dir}
+ git rm -rf ${api_version_dir} || true
+ cp -ar ${target_dir}/site/apidocs ${api_version_dir}
git add -A -f ${api_version_dir}
git commit -m "${commit_message}"
git push -fq origin gh-pages > /dev/null