From 538e5331940983d5d09cb366d9c7c3cbd06e3bce Mon Sep 17 00:00:00 2001 From: Steve Nay <265958+snay2@users.noreply.github.com> Date: Wed, 9 Mar 2022 06:32:06 -0600 Subject: [PATCH] Fix release script prompt when calling from a golang process For some reason, `read -p` doesn't properly print to stdout when invoked by golang's `exec.Command().Run()`, but `echo` does. Reading from stdin still works correctly. --- scripts/prepare-for-release | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/prepare-for-release b/scripts/prepare-for-release index f555423..27825c2 100755 --- a/scripts/prepare-for-release +++ b/scripts/prepare-for-release @@ -154,7 +154,8 @@ confirm_with_user_and_create_pr(){ ${MAGENTA}$(git diff HEAD^ HEAD)${RESET_FMT} EOM while true; do - read -p "🥑${BOLD}Do you wish to create the release prep PR? Enter y/n " yn + echo -e "🥑${BOLD}Do you wish to create the release prep PR? Enter y/n" + read -p "" yn case $yn in [Yy]* ) create_pr; break;; [Nn]* ) rollback; exit;; @@ -232,4 +233,4 @@ main() { confirm_with_user_and_create_pr } -main "$@" \ No newline at end of file +main "$@"