From e2025adf9d1966d243d61e50791afb8773fbbc2d Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sat, 16 Jan 2021 01:13:15 +0100 Subject: [PATCH] ambrevar/shell: Add file->string. --- .local/share/common-lisp/source/ambrevar/shell.lisp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.local/share/common-lisp/source/ambrevar/shell.lisp b/.local/share/common-lisp/source/ambrevar/shell.lisp index 24add64f..738d92a3 100644 --- a/.local/share/common-lisp/source/ambrevar/shell.lisp +++ b/.local/share/common-lisp/source/ambrevar/shell.lisp @@ -20,6 +20,10 @@ (str:split "=" line :limit 2)) (str:split (string #\newline) (cmd:$cmd "env")))) +(export-always 'file->string) +(defun file->string (path) + (sera:chomp (alex:read-file-into-string path))) + (defun assert-program (program &rest more-programs) ; TODO: Is this useful for a REPL? (sera:and-let* ((missing-programs (delete-if #'sera:resolve-executable (cons program more-programs))))