Skip to content

Commit

Permalink
feat(config): make curl path configurable (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
gorillamoe authored Sep 9, 2024
1 parent e732f42 commit ea1b276
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
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

0 comments on commit ea1b276

Please sign in to comment.