diff --git a/system-packages.el b/system-packages.el index d425198..6b3f426 100644 --- a/system-packages.el +++ b/system-packages.el @@ -353,6 +353,22 @@ manger." (interactive "sPackage to install: ") (system-packages--run-command 'install pack args)) +;;;###autoload +(defun system-packages-ensure (pack &optional args) + "Ensure PACK is installed on system. +Search for PACK with `system-packages-package-installed-p', and +install the package if not found. Use ARGS to pass options to +the package manager." + (if (system-packages-package-installed-p pack) + t + (system-packages-install pack args))) + +;;;###autoload +(defalias 'system-packages-package-installed-p #'executable-find + "Return t if PACK is installed. +Currently an alias for `executable-find', so it will give wrong +results if the package and executable names are different.") + ;;;###autoload (defun system-packages-search (pack &optional args) "Search for system packages.