diff options
| author | Teddy Wing | 2022-08-25 21:35:31 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2022-08-25 21:35:31 +0200 | 
| commit | 9bff543aefa274a7a2362802c9c78e1b672d5ce3 (patch) | |
| tree | 505959c40b8bc1b9d6842cbeafcc793fb632e164 /src | |
| parent | ab47e8726d57daa115f3d292a40a36fa1e768818 (diff) | |
| download | extreload-9bff543aefa274a7a2362802c9c78e1b672d5ce3.tar.bz2 | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/option.lisp | 4 | 
1 files changed, 3 insertions, 1 deletions
| 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+)) | 
