From d5c31f89ebf9a7792807442a6ad4d2c3ef26de6d Mon Sep 17 00:00:00 2001 From: acx Date: Fri, 10 Mar 2023 11:12:32 +0200 Subject: [PATCH] Replace open command with xdg-open when install runs on linux --- install.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install.sh b/install.sh index 82d8d4d..8f300a4 100755 --- a/install.sh +++ b/install.sh @@ -29,6 +29,11 @@ fi # Installing chatgpt script curl -sS https://raw.githubusercontent.com/0xacx/chatGPT-shell-cli/main/chatgpt.sh -o /usr/local/bin/chatgpt + +# 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 chmod +x /usr/local/bin/chatgpt echo "Installed chatgpt script to /usr/local/bin/chatgpt"