Closed direster closed 1 year ago
I'm not sure what the intention was for using -h option, but did you mean to use -n for quiet mode (suppress automatic printing of pattern space)?
If that is so, I can fix this or any other minor issues I come across as I use the tool. Please let me know if you would like me to contribute with the change.
Issue at line 35 of install.sh. https://github.com/0xacx/chatGPT-shell-cli/pull/33/commits Offending block of code:
# Replace open image command with xdg-open for linux systems
if [[ "$OSTYPE" == "linux-gnu"* ]] || [[ "$OSTYPE" == "freebsd"* ]]; then
sed -i -h 's/open "\${image_url}"/xdg-open "\${image_url}"/g' '/usr/local/bin/chatgpt'
fi
I've downloaded the install.sh and removed the -h option in the sed command mentioned in above comment, and it works fine now. Note: replacing -h with -n did not work for some reason, so I've completely removed -h option. It looks like this now:
# Replace open image command with xdg-open for linux systems
if [[ "$OSTYPE" == "linux-gnu"* ]] || [[ "$OSTYPE" == "freebsd"* ]]; then
sed -i 's/open "\${image_url}"/xdg-open "\${image_url}"/g' '/usr/local/bin/chatgpt'
fi
Thank you so much for finding this! 🙏
Weirdly, without the -h
flag it doesn't work on mac and I don't understand completely why, but that's fine since this line only needs to work on Linux systems. So just removing it should be good. 👍
if we needed to make that command portable between Mac and Linux then we would need to do it like that
Thanks again for catching this bug! If you find any other, don't hesitate to submit a PR! 🙏
Awesome! Thanks for fixing this so quickly!
First off this is a Great tool! Thank you for developing and sharing this! I've seen an error for sed option during install on pop-os/ubuntu, so raising this issue. Could be an easy fix(?)