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

feat(config): make curl path configurable #226

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/docs/getting-started/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ Here is a full example of setting up the Kulala plugin with the available `opts`
{
"mistweaverco/kulala.nvim",
opts = {
-- cURL path
-- if you have curl installed in a non-standard path,
-- you can specify it here
curl_path = "curl",

-- split direction
-- possible values: "vertical", "horizontal"
split_direction = "vertical",
Expand Down Expand Up @@ -97,6 +102,24 @@ Here is a full example of setting up the Kulala plugin with the available `opts`
}
```

### curl_path

cURL path.

If you have `curl` installed in a non-standard path, you can specify it here.

Default: `curl`

Example:

```lua
{
"mistweaverco/kulala.nvim",
opts = {
curl_path = "/home/bonobo/.local/bin/curl",
},
}
```
### split_direction

Split direction.
Expand Down
4 changes: 4 additions & 0 deletions lua/kulala/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ local FS = require("kulala.utils.fs")
local M = {}

M.defaults = {
-- cURL path
-- if you have curl installed in a non-standard path,
-- you can specify it here
curl_path = "curl",
-- split direction
-- possible values: "vertical", "horizontal"
split_direction = "vertical",
Expand Down
2 changes: 1 addition & 1 deletion lua/kulala/parser/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ function M.parse(start_request_linenr)
end

-- build the command to exectute the request
table.insert(res.cmd, "curl")
table.insert(res.cmd, CONFIG.get().curl_path)
table.insert(res.cmd, "-s")
table.insert(res.cmd, "-D")
table.insert(res.cmd, PLUGIN_TMP_DIR .. "/headers.txt")
Expand Down