From 9bff543aefa274a7a2362802c9c78e1b672d5ce3 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 25 Aug 2022 21:35:31 +0200 Subject: option.lisp: Define version string at compile time Otherwise we get a runtime error when running the binary on a different machine than the one that built it: $ extreload -V error: Failed to find the WRITE-DATE of /private/tmp/extreload-20220825-3720-17mi6k3/extreload_0.0.2/bundle/local-projects/: No such file or directory --- src/option.lisp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/option.lisp b/src/option.lisp index 2a4721f..5848a8d 100644 --- a/src/option.lisp +++ b/src/option.lisp @@ -60,6 +60,8 @@ with code `exit-code`." `condition` and exits with EX_USAGE." (exit-with-error condition sysexits:+usage+)) +(defconstant *version* (asdf:component-version (asdf:find-system :extreload))) + (defun parse-options () "Parse command line options." (multiple-value-bind (options free-args) @@ -79,7 +81,7 @@ with code `exit-code`." (opts:exit sysexits:+usage+)) (when-option (options :version) - (format t "~a~%" (asdf:component-version (asdf:find-system :extreload))) + (format t "~a~%" *version*) (opts:exit sysexits:+ok+)) -- cgit v1.2.3