From 3759bcd641cf60611c13927e83425e773d2bb629 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Thu, 3 Jun 2021 10:06:40 +0200 Subject: [PATCH] Support unattended mode for recipe releasing --- abra | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/abra b/abra index 90215c1..1530333 100755 --- a/abra +++ b/abra @@ -2108,8 +2108,12 @@ sub_recipe_release() { if [ "$(git rev-parse --abbrev-ref --symbolic-full-name HEAD)" = "HEAD" ]; then warning "It looks like $recipe_dir is in 'detached HEAD' state" - read -rp "Check out main/master branch first? [Y/n] " - if [ "${choice,,}" != "n" ]; then + if [ "$abra___no_prompt" = "false" ]; then + read -rp "Check out main/master branch first? [Y/n] " + if [ "${choice,,}" != "n" ]; then + checkout_main_or_master + fi + else checkout_main_or_master fi fi @@ -2197,18 +2201,22 @@ sub_recipe_release() { success "All compose files updated; new version is $new_version" - read -rp "Commit your changes to git? [y/N]? " choice + if [ "$abra___no_prompt" = "false" ]; then + read -rp "Commit your changes to git? [y/N]? " choice - if [ "${choice,,}" != "y" ]; then - return + if [ "${choice,,}" != "y" ]; then + return + fi fi git commit -avem "Version $new_version; sync labels" || exit - read -rp "Tag this as \`$new_version\`? [y/N]? " choice + if [ "$abra___no_prompt" = "false" ]; then + read -rp "Tag this as \`$new_version\`? [y/N]? " choice - if [ "${choice,,}" != "y" ]; then - return + if [ "${choice,,}" != "y" ]; then + return + fi fi test "$force" = "true" && git tag -d "$new_version"