diff options
| author | Craig Jennings <c@cjennings.net> | 2025-11-09 15:33:17 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-11-09 15:33:17 -0600 |
| commit | bace209b19449c366c933a752a289d52e5f40c52 (patch) | |
| tree | 427d54de9c91c47ec6e45cf09eef21514b6ef85a /modules | |
| parent | 8b39650aca87cd619b09deb683cb58f5a420f623 (diff) | |
| download | dotemacs-bace209b19449c366c933a752a289d52e5f40c52.tar.gz dotemacs-bace209b19449c366c933a752a289d52e5f40c52.zip | |
feat:system: Add system utility library with executable check
Introduce a new `system-lib.el` module providing low-level system
utility functions, including function `cj/executable-exists-p` to
check for the availability of programs in PATH. Integrate this
library in `init.el`.
test(system): Add unit tests for executable check function
Create comprehensive unit tests for `cj/executable-exists-p` in
`system-lib.el`, ensuring coverage of normal, boundary and error
scenarios.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/system-lib.el | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/system-lib.el b/modules/system-lib.el new file mode 100644 index 00000000..8bbf8474 --- /dev/null +++ b/modules/system-lib.el @@ -0,0 +1,20 @@ +;;; system-lib.el --- System utility library functions -*- lexical-binding: t; -*- +;; +;;; Commentary: +;; This module provides low-level system utility functions for checking +;; the availability of external programs and system capabilities. +;; +;; Functions include: +;; - Checking if external programs are available in PATH +;; +;;; Code: + +(defun cj/executable-exists-p (program) + "Return non-nil if PROGRAM is available in PATH. +PROGRAM should be a string naming an executable program." + (and (stringp program) + (not (string-empty-p program)) + (executable-find program))) + +(provide 'system-lib) +;;; system-lib.el ends here |
