mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-11-22 04:42:37 +03:00
This needs to be run immediately before creating a release. We could go further here and use gh to create the PR, but since I'm usually logged in with my work account to gh, this won't help me. The git push command prints the URL to create the PR, so it's a simple matter of command-clicking it, which is good enough for me.
32 lines
727 B
Bash
Executable File
32 lines
727 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -euo pipefail
|
|
|
|
st=$(git status --porcelain)
|
|
if [ -n "$st" ]; then
|
|
echo "Working directory is not clean; aborting."
|
|
exit 1
|
|
fi
|
|
|
|
if diff -r -q docs docs-master > /dev/null && diff -r -q schema schema-master > /dev/null; then
|
|
echo "No changes to docs or schema; nothing to do."
|
|
exit 0
|
|
fi
|
|
|
|
branch_name=update-docs-for-release
|
|
|
|
if git show-ref --verify --quiet refs/heads/"$branch_name"; then
|
|
echo "Branch '$branch_name' already exists; aborting."
|
|
exit 1
|
|
fi
|
|
|
|
git checkout -b "$branch_name" --no-track origin/master
|
|
|
|
git rm -r docs schema
|
|
cp -r docs-master docs
|
|
cp -r schema-master schema
|
|
git add docs schema
|
|
git commit -m "Update docs and schema for release"
|
|
|
|
git push -u origin "$branch_name"
|