diff --git a/cog.toml b/cog.toml index 9724e3789..365071dbd 100644 --- a/cog.toml +++ b/cog.toml @@ -16,7 +16,9 @@ post_bump_hooks = [] # bump hooks for package versions, which is what we actually use pre_package_bump_hooks = [ - "echo Updating {{package}} to version {{version}}", + "echo Updating {{package}} from {{latest}} to version {{version}}", + # Confirm the user wishes to proceed + "../../tools/confirm.sh", # make sure user has correct software installed and is authenticated with `gh` cli tool "../../tools/validate.sh", # change the version number of the given plugin in source, and commit it as a chore(version): commit diff --git a/tools/confirm.sh b/tools/confirm.sh new file mode 100755 index 000000000..81cb35f8b --- /dev/null +++ b/tools/confirm.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# This script just prompts the user to confirm they want to continue + +read -p "Continue? (y/n)" -n 1 -r +echo # (optional) move to a new line +if [[ ! $REPLY =~ ^[Yy]$ ]] +then + echo "Aborted." + [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 # handle exits from shell or function but don't exit interactive shell +fi +echo "Continuing..." \ No newline at end of file