Check for encrypted and format to space only

This commit is contained in:
2025-11-03 14:39:33 +01:00
parent 1011be3d1f
commit fe565fec63

View File

@@ -29,11 +29,16 @@ return {
return info("No file selected")
end
if hovered:match("%.gpg$") then
return info("This file is already encrypted")
end
if not default_recipient then
return info("No recipient set")
end
local _, err = Command("gpg"):arg("--yes"):arg("--recipient"):arg(default_recipient):arg("--output"):arg(hovered .. ".gpg"):arg("--encrypt"):arg(hovered):output()
local _, err = Command("gpg"):arg("--yes"):arg("--recipient"):arg(default_recipient):arg("--output"):arg(hovered ..
".gpg"):arg("--encrypt"):arg(hovered):output()
if err then
return info("Failed to gpg with error: " .. err)
end