Function: sops--ensure-version

sops--ensure-version is a natively compiled function defined in sops.el.

Signature

(sops--ensure-version)

Documentation

Verify sops binary exists and is >= 3.9.0. Return version string.

Signals user-error if sops is missing or too old. Caches result.

Source Code

;; Defined in /nix/store/vihl6lkzddv9xrsrsznvqdjq27g2i30p-emacs-packages-deps/share/emacs/site-lisp/elpa/sops-20260920.2121/sops.el
(defun sops--ensure-version ()
  "Verify sops binary exists and is >= 3.9.0.  Return version string.
Signals `user-error' if sops is missing or too old.  Caches result."
  (when (or (null sops--version-cache)
            (not (equal (car sops--version-cache) sops-executable)))
    (unless (executable-find sops-executable)
      (user-error "Sops: executable not found: %s" sops-executable))
    (let* ((result (sops--run '("--version")))
           (out (plist-get result :stdout))
           (version (when (string-match "[0-9]+\\.[0-9]+\\.[0-9]+" out)
                      (match-string 0 out))))
      (unless (and version (version<= "3.9.0" version))
        (user-error "Sops: requires >= 3.9.0, found %s"
                    (or version "unknown")))
      (setq sops--version-cache (cons sops-executable version))))
  (cdr sops--version-cache))