[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/06: ui: Look up extensions before built-in commands.
From: |
guix-commits |
Subject: |
06/06: ui: Look up extensions before built-in commands. |
Date: |
Thu, 28 Jan 2021 09:09:25 -0500 (EST) |
rekado pushed a commit to branch master
in repository guix.
commit 95852b305bcdcb7dea4575da3e1f8fbb9c292bd7
Author: zimoun <zimon.toutoune@gmail.com>
AuthorDate: Sat Jan 16 01:57:08 2021 +0100
ui: Look up extensions before built-in commands.
* guix/ui.scm (run-guix-command): Modify order so that extensions are
allowed
to override default commands.
Co-authored-by: Ricardo Wurmus <rekado@elephly.net>
---
guix/ui.scm | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/guix/ui.scm b/guix/ui.scm
index bd504c6..45ae14f 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -2124,24 +2124,20 @@ Run COMMAND with ARGS.\n"))
"Run COMMAND with the given ARGS. Report an error when COMMAND is not
found."
(define module
- (catch 'misc-error
- (lambda ()
- (resolve-interface `(guix scripts ,command)))
- (lambda _
- ;; Check if there is a matching extension.
- (catch 'misc-error
- (lambda ()
- (match (search-path (extension-directories)
- (format #f "~a.scm" command))
- (#f
- (throw 'misc-error))
- (file
- (load file)
- (resolve-interface `(guix extensions ,command)))))
- (lambda _
- (format (current-error-port)
- (G_ "guix: ~a: command not found~%") command)
- (show-guix-usage))))))
+ ;; Check if there is a matching extension.
+ (match (search-path (extension-directories)
+ (format #f "~a.scm" command))
+ (#f
+ (catch 'misc-error
+ (lambda ()
+ (resolve-interface `(guix scripts ,command)))
+ (lambda _
+ (format (current-error-port)
+ (G_ "guix: ~a: command not found~%") command)
+ (show-guix-usage))))
+ (file
+ (load file)
+ (resolve-interface `(guix extensions ,command)))))
(let ((command-main (module-ref module
(symbol-append 'guix- command))))
- branch master updated (b9650f7 -> 95852b3), guix-commits, 2021/01/28
- 02/06: gnu: Add trf., guix-commits, 2021/01/28
- 03/06: guix: Add Open Software License 2.1., guix-commits, 2021/01/28
- 01/06: guix: Fix typo., guix-commits, 2021/01/28
- 06/06: ui: Look up extensions before built-in commands.,
guix-commits <=
- 04/06: gnu: Add perl-text-soundex., guix-commits, 2021/01/28
- 05/06: gnu: Add repeat-masker., guix-commits, 2021/01/28