Skip to content

Commit e042985

Browse files
authored
Fix release script prompt when calling from a golang process (#116)
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.
1 parent 2aee60a commit e042985

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/prepare-for-release

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ confirm_with_user_and_create_pr(){
154154
${MAGENTA}$(git diff HEAD^ HEAD)${RESET_FMT}
155155
EOM
156156
while true; do
157-
read -p "🥑${BOLD}Do you wish to create the release prep PR? Enter y/n " yn
157+
echo -e "🥑${BOLD}Do you wish to create the release prep PR? Enter y/n"
158+
read -p "" yn
158159
case $yn in
159160
[Yy]* ) create_pr; break;;
160161
[Nn]* ) rollback; exit;;
@@ -232,4 +233,4 @@ main() {
232233
confirm_with_user_and_create_pr
233234
}
234235

235-
main "$@"
236+
main "$@"

0 commit comments

Comments
 (0)