From 3b335bb401524a6a1a95270a2b15ad2c46842568 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 22 May 2022 01:58:15 +0200 Subject: option.lisp: Move program version to macro When I tried building with Homebrew, I got this error: $ wajir --version error: Failed to find the WRITE-DATE of /private/tmp/wajir-20220522-65276-i3kj2/bundle/local-projects/: No such file or directory Try and pre-compile the program version to counter this error. --- src/option.lisp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/option.lisp b/src/option.lisp index 466a229..fdb0a33 100644 --- a/src/option.lisp +++ b/src/option.lisp @@ -78,6 +78,10 @@ with code `exit-code`." `condition` and exits with EX_USAGE." (exit-with-error condition sysexits:+usage+)) +(defmacro program-version () + "Program version string" + (asdf:component-version (asdf:find-system :wajir))) + (defun parse-options () "Parse command line options." (multiple-value-bind (options free-args) @@ -99,7 +103,7 @@ with code `exit-code`." ;; Version (when-option (options :version) - (format t "~a~%" (asdf:component-version (asdf:find-system :wajir))) + (format t "~a~%" (program-version)) (opts:exit sysexits:+ok+)) -- cgit v1.2.3