Remove REMOTE arg from `eshell-info-banner--executable-find'

`eshell-info-banner--executable-find' now only acts according to the
user’s preferences set with `eshell-info-banner-tramp-aware'.
This commit is contained in:
Lucien Cartier-Tilet 2021-12-20 23:08:31 +01:00
parent 382bb55064
commit 661ae7c87d
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
2 changed files with 16 additions and 10 deletions

View File

@ -22,6 +22,7 @@ macOS. PR are welcome if you want to fix that!
* Table of Contents :TOC_2_gh: * Table of Contents :TOC_2_gh:
- [[#introduction][Introduction]] - [[#introduction][Introduction]]
- [[#recent-breaking-changes][Recent Breaking Changes]] - [[#recent-breaking-changes][Recent Breaking Changes]]
- [[#081][~0.8.1~]]
- [[#070][~0.7.0~]] - [[#070][~0.7.0~]]
- [[#installation][Installation]] - [[#installation][Installation]]
- [[#customizing][Customizing]] - [[#customizing][Customizing]]
@ -33,6 +34,11 @@ macOS. PR are welcome if you want to fix that!
- [[#license][License]] - [[#license][License]]
* Recent Breaking Changes * Recent Breaking Changes
** ~0.8.1~
Version ~0.8.1~ removes the optional argument ~REMOTE~ from
~eshell-info-banner--executable-find~. It now only acts according to the
users preference set with ~eshell-info-banner-tramp-aware~.
** ~0.7.0~ ** ~0.7.0~
Version ~0.7.0~ renames several functions to conform with the Elisp Version ~0.7.0~ renames several functions to conform with the Elisp
Coding Conventions. Coding Conventions.

View File

@ -2,7 +2,7 @@
;; Author: Lucien Cartier-Tilet <lucien@phundrak.com> ;; Author: Lucien Cartier-Tilet <lucien@phundrak.com>
;; Maintainer: Lucien Cartier-Tilet <lucien@phundrak.com> ;; Maintainer: Lucien Cartier-Tilet <lucien@phundrak.com>
;; Version: 0.8.0 ;; Version: 0.8.1
;; Package-Requires: ((emacs "25.1") (f "0.20") (s "1")) ;; Package-Requires: ((emacs "25.1") (f "0.20") (s "1"))
;; Homepage: https://github.com/Phundrak/eshell-info-banner.el ;; Homepage: https://github.com/Phundrak/eshell-info-banner.el
@ -140,18 +140,18 @@
:type 'list :type 'list
:version "0.3.0") :version "0.3.0")
(defun eshell-info-banner--executable-find (program &optional remote) (defun eshell-info-banner--executable-find (program)
"Find PROGRAM executable, possibly on a REMOTE machine. "Find PROGRAM executable, possibly on a remote machine.
This is a wrapper around `executable-find' in order to avoid This is a wrapper around `executable-find' in order to avoid
issues with older versions of the functions only accepting one issues with older versions of the functions only accepting one
argument." argument. `executable-find's remote argument has the value of
`eshell-info-banner-tramp-aware'."
(if (version< emacs-version "27.1") (if (version< emacs-version "27.1")
(let ((default-directory (if (and eshell-info-banner-tramp-aware (let ((default-directory (if eshell-info-banner-tramp-aware
remote)
default-directory default-directory
"~"))) "~")))
(executable-find program)) (executable-find program))
(executable-find program remote))) (executable-find program eshell-info-banner-tramp-aware)))
(defcustom eshell-info-banner-duf-executable "duf" (defcustom eshell-info-banner-duf-executable "duf"
"Path to the `duf' executable." "Path to the `duf' executable."
@ -681,7 +681,7 @@ If RELEASE-FILE is nil, use '/etc/os-release'."
(insert-file-contents (concat prefix "/bedrock/etc/bedrock-release")) (insert-file-contents (concat prefix "/bedrock/etc/bedrock-release"))
(buffer-string)))) (buffer-string))))
;; Proxmox ;; Proxmox
((eshell-info-banner--executable-find "pveversion" eshell-info-banner-tramp-aware) ((eshell-info-banner--executable-find "pveversion")
(let ((distro (eshell-info-banner--shell-command-to-string "pveversion"))) (let ((distro (eshell-info-banner--shell-command-to-string "pveversion")))
(save-match-data (save-match-data
(string-match "/\\([^/]+\\)/" distro) (string-match "/\\([^/]+\\)/" distro)
@ -689,9 +689,9 @@ If RELEASE-FILE is nil, use '/etc/os-release'."
(substring-no-properties distro (substring-no-properties distro
(match-beginning 1) (match-beginning 1)
(match-end 1)))))) (match-end 1))))))
((eshell-info-banner--executable-find "hostnamectl" eshell-info-banner-tramp-aware) ((eshell-info-banner--executable-find "hostnamectl")
(eshell-info-banner--get-os-information-from-hostnamectl)) (eshell-info-banner--get-os-information-from-hostnamectl))
((eshell-info-banner--executable-find "lsb_release" eshell-info-banner-tramp-aware) ((eshell-info-banner--executable-find "lsb_release")
(eshell-info-banner--get-os-information-from-lsb-release)) (eshell-info-banner--get-os-information-from-lsb-release))
((file-exists-p (concat prefix "/etc/os-release")) ((file-exists-p (concat prefix "/etc/os-release"))
(eshell-info-banner--get-os-information-from-release-file)) (eshell-info-banner--get-os-information-from-release-file))