File: update_docs_for_release.sh

package info (click to toggle)
lazygit 0.57.0%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,748 kB
  • sloc: sh: 153; makefile: 76
file content (31 lines) | stat: -rwxr-xr-x 727 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/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"