depot/third_party/copybara/scripts/update_docs

14 lines
464 B
Text
Raw Permalink Normal View History

#!/bin/bash
bazel build java/com/google/copybara:docs
mkdir -p docs
cp bazel-bin/java/com/google/copybara/docs.md docs/reference.md
git add docs/reference.md
# If -a we ammend the current head commit
if [[ $1 == '-a' ]]; then
echo "Ammending current commit ($(git rev-parse HEAD))"
git commit docs/reference.md --amend -C HEAD
else
echo "Creating a new commit"
git commit docs/reference.md -m "Update reference documentation to latest version"
fi