Skip to content

Commit

Permalink
works
Browse files Browse the repository at this point in the history
  • Loading branch information
conneroisu committed May 1, 2024
1 parent 4b9c497 commit 811cc44
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 19 deletions.
4 changes: 2 additions & 2 deletions lua/doppler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ M.setup = function(args)
M.config = vim.tbl_deep_extend("force", M.config, args or {})
end

M.hello = function()
return module.my_first_function(M.config.opt)
M.doppler_configs = function()
return module.doppler_configs(M.config.opt)
end

return M
6 changes: 3 additions & 3 deletions lua/doppler/module.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---@class CustomModule
local M = {}

---@return string
M.my_first_function = function(greeting)
return greeting
---@return nil
M.doppler_configs = function()
vim.cmd("!doppler configs")
end

return M
5 changes: 5 additions & 0 deletions plugin/doppler.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
vim.api.nvim_create_user_command("DopplerConfigs", require("doppler").doppler_configs, {})

vim.cmd("silent !set -a")
vim.cmd("silent !source <(doppler secrets download --no-file --format env)")
vim.cmd("silent !set +a")
8 changes: 0 additions & 8 deletions plugin/doppler.nvim.lua

This file was deleted.

8 changes: 2 additions & 6 deletions tests/doppler.nvim/plugin_name_spec.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
local plugin = require("plugin.doppler.nvim")
local plugin = require("doppler")

describe("setup", function()
it("works with default", function()
assert(plugin.hello() == "Hello!", "my first function with param = Hello!")
assert(plugin.doppler_configs ~= "Hello!", "my first function with param = Hello!")
end)

it("works with custom var", function()
plugin.setup({ opt = "custom" })
assert(plugin.hello() == "custom", "my first function with param = custom")
end)
end)

0 comments on commit 811cc44

Please sign in to comment.