1
0
Преглед на файлове

secret/with with wiping

Innocenty Enikeev преди 8 години
родител
ревизия
6bb15f3281
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 6 0
      secrets.lisp

+ 6 - 0
secrets.lisp

@@ -20,3 +20,9 @@
   (with-input-from-string (input value)
   (with-input-from-string (input value)
     (%secret/pass (format nil "insert --force  --multiline ~{~A~^/~}" path)
     (%secret/pass (format nil "insert --force  --multiline ~{~A~^/~}" path)
                   :input input :output :string)))
                   :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))))