forked from deepStateMirrors/tabi
👷 misc(release): ensure script is ran from default branch
This commit is contained in:
parent
c2519c51d6
commit
82f7a984d5
1 changed files with 7 additions and 0 deletions
7
release
7
release
|
@ -10,6 +10,13 @@ exit_with_message() {
|
|||
exit 1
|
||||
}
|
||||
|
||||
# Run only from default branch.
|
||||
default_branch=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')
|
||||
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
if [ "$current_branch" != "$default_branch" ]; then
|
||||
exit_with_message "Not on $default_branch branch. Switch to $default_branch before running this script."
|
||||
fi
|
||||
|
||||
# Check for a clean working directory.
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
exit_with_message "Your working directory is dirty. Commit or stash your changes before running this script."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue