blob: c182c3dec7d6c50c4ae4b9e3774cf22101fe6b04 [file] [log] [blame]
#!/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