Ver Fonte

secret/with with wiping

Innocenty Enikeev há 8 anos atrás
pai
commit
6bb15f3281
1 ficheiros alterados com 6 adições e 0 exclusões
  1. 6 0
      secrets.lisp

+ 6 - 0
secrets.lisp

@@ -20,3 +20,9 @@
   (with-input-from-string (input value)
     (%secret/pass (format nil "insert --force  --multiline ~{~A~^/~}" path)
                   :input input :output :string)))
+
+(defmacro secret/with ((var path) &body body)
+  `(let ((,var (ignore-errors (secret/get ,path))))
+     (unwind-protect
+          (progn ,@body)
+       (fill ,var #\Space))))