blob: 76193a3728b561b3fad589fe34b0155b9fa57cda [file] [log] [blame] [edit]
#!/bin/bash
set -ex
for arg in "$@"; do
case "${arg}" in
--no-commit)
no_commit="true"
;;
*)
>&2 echo "Unrecognized option: ${arg}"
exit 2
esac
done
echo "Going to setup a kunit-docs/ repo adjacent to this one"
# Get to the root of the repo
cd $(git rev-parse --show-toplevel)
cd ..
if [[ ! -d kunit-docs/ ]]; then
git clone git@github.com:google/kunit-docs.git
cd kunit-docs/
else # re-use the existing one but force it to be up to date
cd kunit-docs/
git fetch
git checkout origin/master
fi
git ls-files -z | xargs -0 rm -f
cp -r ../kunit-website/_build/html/. ./
[[ -n $no_commit ]] && exit 0
git add -A
git commit
git push git@github.com:google/kunit-docs.git HEAD:master