dotfiles/nvim/ftplugin/php/decrypt_intelephense_key.lua

20 lines
487 B
Lua
Raw Permalink Normal View History

2025-02-18 21:28:13 +00:00
local key_file_path = vim.fn.stdpath('config') .. '/intelephense-license'
local f = io.open(key_file_path, 'r')
if f ~= nil then
f:close()
return
end
vim.notify("Decrypting intelephense license key", vim.log.levels.INFO)
vim.system(
{ "gpg", "--decrypt", "--output", key_file_path, key_file_path .. ".asc" },
{ text = true },
function(out)
if out.code ~= 0 then
print("Failed to decrypt intelephense key: " .. out.stderr)
end
end
)