guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] edit: Friendlier error message.


From: benno
Subject: [PATCH] edit: Friendlier error message.
Date: Wed, 4 Nov 2015 23:42:15 +0100

From: Benno Evers <address@hidden>

* guix/scripts/edit.scm (guix-edit): Check if %editor exists.
---
These are my first lines of guile, so probably there is a much
better way to do this :D

The previous error message ("execlp: No such file or directory")
had me confused for a while, though.

 guix/scripts/edit.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/guix/scripts/edit.scm b/guix/scripts/edit.scm
index 30146af..9225629 100644
--- a/guix/scripts/edit.scm
+++ b/guix/scripts/edit.scm
@@ -62,6 +62,9 @@ Start $EDITOR to edit the definitions of PACKAGE...\n"))
 
 (define (guix-edit . args)
   (with-error-handling
+    (unless (search-path (parse-path (getenv "PATH")) (%editor))
+      (leave (_ "Couldn't find editor '~a'. Please check $EDITOR and $PATH.")
+             (%editor)))
     (let* ((specs    (parse-command-line args %options '(())
                                          #:argument-handler cons))
            (packages (map specification->package specs)))
-- 
2.5.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]