(Emacs/elisp)~fix eshell-prompt not showing changed files correctly

Simple fix as I didn't call the command before splitting the string
This commit is contained in:
2024-06-27 16:04:14 +01:00
parent df99c034f7
commit 3588b03713

View File

@@ -65,7 +65,7 @@ a repository. If there are no changes i.e. the worktree is clean
then a green tick is returned, but if there are changes then the
number of files affected are returned in red."
(let* ((git-cmd "git status -s")
(command-output (split-string git-cmd))
(command-output (split-string (shell-command-to-string git-cmd) "\n"))
(changed-files (- (length command-output) 1)))
(if (= changed-files 0)
(propertize "" 'font-lock-face '(:foreground "green"))