2021-01-12 10:56:00 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
### Bash Environment Setup
|
|
|
|
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
|
|
|
|
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
|
|
|
|
# set -o xtrace
|
|
|
|
set -o errexit
|
|
|
|
set -o errtrace
|
|
|
|
set -o nounset
|
|
|
|
set -o pipefail
|
|
|
|
IFS=$'\n'
|
|
|
|
|
|
|
|
REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )"
|
|
|
|
|
|
|
|
cd "$REPO_DIR"
|
|
|
|
source "./.venv/bin/activate"
|
|
|
|
|
|
|
|
|
|
|
|
# Make sure git is clean
|
|
|
|
if [ -z "$(git status --porcelain)" ] && [[ "$(git branch --show-current)" == "master" ]]; then
|
|
|
|
git pull
|
|
|
|
else
|
|
|
|
echo "[!] Warning: git status is dirty!"
|
|
|
|
echo " Press Ctrl-C to cancel, or wait 10sec to continue..."
|
|
|
|
sleep 10
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Bump version number in source
|
|
|
|
function bump_semver {
|
|
|
|
echo "$1" | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g'
|
|
|
|
}
|
|
|
|
|
2024-10-05 10:51:47 +00:00
|
|
|
# OLD_VERSION="$(grep '^version = ' "${REPO_DIR}/pyproject.toml" | awk -F'"' '{print $2}')"
|
|
|
|
# NEW_VERSION="$(bump_semver "$OLD_VERSION")"
|
2021-01-12 10:56:00 +00:00
|
|
|
|