Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows support #89

Open
hfn92 opened this issue Sep 15, 2023 · 0 comments
Open

windows support #89

hfn92 opened this issue Sep 15, 2023 · 0 comments

Comments

@hfn92
Copy link

hfn92 commented Sep 15, 2023

I'm sometimes forced to use windows and I'd still like to be able to use gh.nvim

I've identified two issues under windows.

  1. temp dir - /tmp is not available under window. gh.nvim can't show diffs because it cant pull the source files. I don't know what a sensible temp dir is for windows. But I think being able to configure the the temp dir would solve the issue.

  2. some gh cli invokations fail. Not sure why. But the body is cut off if a comment contains "\n":
    '{"message":"Validation Failed","errors":[{"resource":"IssueComment","code":"unprocessable","field":"data","message":"Body cannot be blank"}],"documentation_url":https://docs.github.com/enterprise-server@3.9/rest/reference/issues#create-an-issue-comment}gh: Validation Failed (HTTP 422)\n'
    I was able to fix the by changing the way vim.fn.system is called

   -- from this
    local cmd = string.format([[gh api -X POST /repos/{owner}/{repo}/issues/%d/comments -f body=%s]], number, body)
    -- to this
    local cmd = {
      "gh",
      "api",
      "-X",
      "POST",
      string.format([[/repos/{owner}/{repo}/issues/%s/comments]], number),
      "-f",
      string.format([[body=%s]], body:sub(2, #body - 1)), -- remove " from the beginning and end
    }

I fixed what didn't work for me on this branch hfn92@470ec8f
I'm unsure about side effects 😟 But what do you think. Are those reasonable changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant