spin_sleep 0.3.7

Accurate sleeping. Only use native sleep as far as it can be trusted, then spin.
Documentation
#!/usr/bin/env bash

set -eu
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$dir"

tagname=$(grep -m1 version Cargo.toml | cut -d '"' -f2)

if git rev-parse "$tagname" >/dev/null 2>&1
then
  echo "tag $tagname already exists" >&2
  exit 1
fi

echo "Release $tagname"
read -p "continue? [y/N] " -n 1 -r
echo
if ! [[ $REPLY =~ ^[^Nn]$ ]]; then
  exit 0
fi

git tag -s "$tagname" -m "Release $tagname"
git push --tags

gio open "https://github.com/alexheretic/spin-sleep/releases/new?tag=$tagname"