Skip to content

Commit

Permalink
fix: don't override already added secrets (issue: #188)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robitx committed Aug 5, 2024
1 parent 3510217 commit 757c78f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/gp/vault.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ end
---@param name string # provider name
---@param secret string | table | nil # secret or command to retrieve it
V.add_secret = function(name, secret)
name = alias[name] or name
if secrets[name] then
logger.debug("vault secret " .. name .. " already exists", true)
return
end
local s = { secret = secret }
s = vim.deepcopy(s)
name = alias[name] or name
secrets[name] = s.secret
logger.debug("vault adding secret " .. name .. ": " .. vim.inspect(s.secret), true)
end
Expand Down

0 comments on commit 757c78f

Please sign in to comment.