diff --git a/wix-cli.sh b/wix-cli.sh index 05ae895..dd87105 100755 --- a/wix-cli.sh +++ b/wix-cli.sh @@ -141,12 +141,21 @@ commit() { if grep -q "OPENAI_API_KEY=" "${datadir}/.env" && grep -q "USE_SMART_COMMIT=true" "${datadir}/.env" ; then IFS=$'\n' lines=($(python3 "$scriptdir/services/openai_service.py" "smart")) h2_text "GPT-3 Suggestion" - h2_text "Title:${RESET} ${lines[0]}" - h2_text "Description:${RESET} ${lines[1]}" - echo "" - info_text "Press enter to use this suggestion or type your own description." - read -r description - git commit -m "${description:-${lines[0]}}" -m "${lines[1]}" + if using_zsh; then + h2_text "Title:${RESET} ${lines[1]}" + h2_text "Description:${RESET} ${lines[2]}" + echo "" + info_text "Press enter to use this suggestion or type your own description." + read -r description + git commit -m "${description:-${lines[1]}}" -m "${lines[2]}" + else + h2_text "Title:${RESET} ${lines[0]}" + h2_text "Description:${RESET} ${lines[1]}" + echo "" + info_text "Press enter to use this suggestion or type your own description." + read -r description + git commit -m "${description:-${lines[0]}}" -m "${lines[1]}" + fi else info_text "Provide a commit description: (defaults to 'wix-cli quick commit')" read -r description