branch: elpa/age
commit 02da4271d4a5d2ebdf7e8c366f1c887e3639ecb6
Merge: 43090e31659 a1c9d0a7911
Author: Bas Alberts <[email protected]>
Commit: GitHub <[email protected]>

    Merge pull request #16 from anticomputer/improve_error_handling
    
    Fall back to a static version when age --version is unknown.
---
 age.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/age.el b/age.el
index a974864ee60..a56be27dd82 100644
--- a/age.el
+++ b/age.el
@@ -197,8 +197,11 @@ version requirement is met."
          (pcase (shell-command-to-string (format "%s --version" program))
            ;; assuming https://semver.org/
            ((rx (let v (seq (+ digit) "." (+ digit) "." (+ digit)))) v)
-           ((rx "(devel)") "9.9.9")
-           (_ nil))))
+           ;; fall back to assuming a compatible version for PROGRAM
+           ;; certain distributions build age without version info
+           (_ (progn
+                (message "WARNING: age.el could not determine version for %s, 
falling back to 9.9.9" program)
+                "9.9.9")))))
     (list (cons 'program program)
           (cons 'version version))))
 

Reply via email to