소스 검색

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)
     (%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))))