out-of-cheese-error / the-way

A code snippets manager for your terminal.
MIT License
354 stars 16 forks source link

Sync Error #86

Closed johnhayesio closed 3 years ago

johnhayesio commented 3 years ago

Tried using the-way sync and pasting the Github token with gists enabled, but getting this returned:

Error: 0: SyncError: "422 {\"message\":\"Validation Failed\",\"errors\":[{\"resource\":\"Gist\",\"code\":\"missing_field\",\"field\":\"files\"}],\"documentation_url\":\"https://docs.github.com/v3/gists/#create-a-gist\"}"

Suggestion: Make sure your GitHub access token is valid. Get one from https://github.com/settings/tokens/new (add the "gist" scope). Set it to the environment variable $THE_WAY_GITHUB_TOKEN

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it. Run with RUST_BACKTRACE=full to include source snippets.

Also added the token into a env var as suggested, but same error is thrown.

Ninjani commented 3 years ago

I could replicate this when trying to sync without having any snippets stored - is it the same situation for you or do you have some snippets and it's still throwing an error?

I've made a fix that prints "No snippets to sync." instead of this error, it'll be in the next release later today.

johnhayesio commented 3 years ago

Alright, so I didn't have any snippets added. I went ahead and added a couple before trying to sync as can be seen here: https://share.getcloudapp.com/12urggz8. After adding the snippets, I then ran the-way sync again adding in the token and was given this error: https://share.getcloudapp.com/2NujzzNG. I also tried adding the env var to my zshrc file again, but got the same error.

Ninjani commented 3 years ago

Yes, this error I'm familiar with and is fixed (3d8d0c3) on master. I'll make a new release now, let me know if that fixes it!

Ninjani commented 3 years ago

Okay, new release is out (here). Could you try it out? You'll need to export and re-import as written in the release notes.

johnhayesio commented 3 years ago

Everything is cleared up on my end now. Thanks a ton!