micha / resty

Little command line REST client that you can use in pipelines (bash or zsh).
MIT License
2.65k stars 143 forks source link

Help debugging resty on zsh with prezto #78

Open pedroxs opened 7 years ago

pedroxs commented 7 years ago

I am getting the following exceptions when trying resty (latest master branch or v2.3).

~❯ curl -L https://raw.githubusercontent.com/micha/resty/master/resty > resty
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 11021  100 11021    0     0  11021      0  0:00:01 --:--:--  0:00:01 27621
~❯ source resty
~❯ resty https://api.github.com -H "Accept: application/vnd.github.v3+json"
https://api.github.com*
~❯ GET /
resty-call:30: file exists: /home/pedroxs/.resty/host
resty-call:124: file exists: /tmp/tmp.gzG7ogJHy5/tmp.6k9IFD6BaO

~❯ GET / --dry-run
resty-call:30: file exists: /home/pedroxs/.resty/host
curl -sLv '' -X GET -b "/home/pedroxs/.resty/c/api.github.com" -c "/home/pedroxs/.resty/c/api.github.com" -H Accept:\ application/vnd.github.v3+json "https://api.github.com/"
~❯ 

I have prezto installed and believe it has something to do with the issue because if I switch to another user (without prezto) everything works fine. The problem is, I have no idea where to start looking to debug this.

I am running zsh 5.4.2 (x86_64-unknown-linux-gnu) with Manjaro Linux 4.11.12-1-rt16-MANJARO x86_64

Thanks

AdrieanKhisbe commented 7 years ago

It seems you are using master, now 3.0 (I can tell because of the resty-call).

What is your prezto config?

pedroxs commented 7 years ago

My config for prezto. I just updated from remote and still getting same error.

pedroxs commented 6 years ago

Hey @AdrieanKhisbe where you able to take a look into this? Do have any tips or point me in a direction where I could debug this on my machine?

belak commented 6 years ago

I believe this is related to the noclobber option we set in prezto.

This can be overridden on a case by case basis by using >| rather than simply >, or locally disabling the setting (which isn't as easy to do if you're trying to support both bash and zsh)

pedroxs commented 6 years ago

@belak thanks for the help, I edited resty with your suggestion and it is working now! :+1:

I will submit a PR with my changes so we may close this and related issue I opened on prezto repo.