XInTheDark / raycast-g4f

Raycast extension to use GPT-4, Llama-3, and more... all for FREE. No API Key required!
GNU General Public License v3.0
407 stars 36 forks source link

Auto Updating doesn't seem to work #113

Closed marcelharinck closed 1 month ago

marcelharinck commented 1 month ago

Description Not able to update from 3.4 to 3.5

To Reproduce Steps to reproduce the behavior:

  1. Go to Check for Updates
  2. Click on 'Update' when asked
  3. Immediately see error 'Update Failed'

Expected behavior A clear and concise description of what you expected to happen.

Screenshots/Recordings image image

Information

XInTheDark commented 1 month ago

Hi! In the source code folder, can you:

marcelharinck commented 1 month ago

There you go:

Error: Update failed

update.jsx:80:12

---
77:       popToRoot();
78:     } else {
79:       showToast(Toast.Style.Failure, "Update failed");
80:       throw new Error("Update failed");
81:     }
82:   });
83: };
---

ChildProcess.exithandler:node:child_process:430:5
ChildProcess.emit:node:events:519:28
ChildProcess.emit:node:domain:488:12
XInTheDark commented 1 month ago

Hey! Sorry for the delay. I suspect either git or npm isn't installed on your machine - the script relies on those to download and install the update. Could you list the output of the following commands in terminal:

thanks!

marcelharinck commented 1 month ago

Hmm seem to have both though:

git version 2.46.0
10.8.2
/opt/homebrew/bin/npm
/opt/homebrew/bin/npm
curl 8.7.1 (x86_64-apple-darwin23.0) libcurl/8.7.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.61.0
Release-Date: 2024-03-27
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL threadsafe UnixSockets
mharinck@NL-H322HVW35J ~ %
XInTheDark commented 1 month ago

Hey, I just resolved this in eddf102; it will also be available in the next update. Could you confirm that it works after the next update? Thanks.

ghost commented 1 month ago

Auto-update doesn't work for me either

First, the Homebrew path is missing from the PATH variable export PATH="/usr/local/bin:/opt/homebrew/bin:$PATH"

Second, I had no success refreshing the extension using npm run build unlike with npm run dev I can see the changes in ~/.config/raycast/extensions, but neither restarting nor clearing the cache helps

XInTheDark commented 1 month ago

Hi @aloshev! I'll look more into the auto-update

Could you check that the latest version of the update script is still not working? (e.g. by manually decreasing the version in package.json then running the update command). In particular I've recently updated this: https://github.com/XInTheDark/raycast-g4f/blob/1360e6871a355531d4642b45b046350c4372168c/assets/scripts/update.sh#L11

which should probably fix the Homebrew path issue.

Regarding the second point about using npm run build - does the extension simply not update when you run it manually on the command line? If so, I might need to ask the raycast team, and possibly switch to using npm run dev everywhere.

Thanks!

ghost commented 1 month ago

The latest version has an error: ⁠env: node: No such file or directory. This happens because npm is an alias to a js script that requires node in the environment

If you only decrease the version, you might miss the extension not refreshing. For example, updating from 3.8 to 3.9 will succeed, but the Tavily API Keys field will still remain in the settings

https://github.com/user-attachments/assets/43ee1588-66f9-4378-8844-a80eaed48636

XInTheDark commented 1 month ago

Hey - I can confirm that this happens.

After doing a bit of experimenting, apparently:

Since this is the case, I'll be updating all the scripts and instructions to use only npm run dev. Will get back to you soon!

XInTheDark commented 1 month ago

I've hopefully fixed this in #123

ghost commented 1 month ago

@XInTheDark Hey, I noticed two issues:

1) ⁠/opt/homebrew/bin is still missing from the PATH in the script https://github.com/XInTheDark/raycast-g4f/blob/0f6fe55c5e0001d06122458ce248d45134f63cff/assets/scripts/update.sh#L10

2) Does not exit developer mode after killing npm I suggest killing the ray process instead - kill $(pgrep ray) https://github.com/XInTheDark/raycast-g4f/blob/0f6fe55c5e0001d06122458ce248d45134f63cff/assets/scripts/update.sh#L60

XInTheDark commented 1 month ago

Hi, regarding this:

Does not exit developer mode after killing npm I suggest killing the ray process instead - kill $(pgrep ray)

Is there a specific reason for this? Not sure what the ray process does, beside building the extension then communicating with Raycast app. Killing the developer mode historically worked fine, since there wouldn't be any difference to the extension after developer mode is killed

ghost commented 1 month ago

Sorry, I wasn’t clear. For me, exiting developer mode by killing npm doesn’t work properly. The extension commands stay permanently pinned in Raycast's development section, and the ray process doesn’t terminate along with the npm process

XInTheDark commented 1 month ago

Ohh I see - does terminating the ray process work for you? If so I'll push a bug fix

ghost commented 1 month ago

Yes, with the two fixes I mentioned before, updating works as expected

XInTheDark commented 1 month ago

Done with 3f008bf2c17faa65674969f2b0acdcfe0cb6a8ec - can you check if it works for you now?

XInTheDark commented 1 month ago

fixes released in v3.9.1, will close this issue for now :)