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>
This commit is contained in:
parent
04b1a1f6bd
commit
95852b305b
1 changed files with 14 additions and 18 deletions
32
guix/ui.scm
32
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
|
"Run COMMAND with the given ARGS. Report an error when COMMAND is not
|
||||||
found."
|
found."
|
||||||
(define module
|
(define module
|
||||||
(catch 'misc-error
|
;; Check if there is a matching extension.
|
||||||
(lambda ()
|
(match (search-path (extension-directories)
|
||||||
(resolve-interface `(guix scripts ,command)))
|
(format #f "~a.scm" command))
|
||||||
(lambda _
|
(#f
|
||||||
;; Check if there is a matching extension.
|
(catch 'misc-error
|
||||||
(catch 'misc-error
|
(lambda ()
|
||||||
(lambda ()
|
(resolve-interface `(guix scripts ,command)))
|
||||||
(match (search-path (extension-directories)
|
(lambda _
|
||||||
(format #f "~a.scm" command))
|
(format (current-error-port)
|
||||||
(#f
|
(G_ "guix: ~a: command not found~%") command)
|
||||||
(throw 'misc-error))
|
(show-guix-usage))))
|
||||||
(file
|
(file
|
||||||
(load file)
|
(load file)
|
||||||
(resolve-interface `(guix extensions ,command)))))
|
(resolve-interface `(guix extensions ,command)))))
|
||||||
(lambda _
|
|
||||||
(format (current-error-port)
|
|
||||||
(G_ "guix: ~a: command not found~%") command)
|
|
||||||
(show-guix-usage))))))
|
|
||||||
|
|
||||||
(let ((command-main (module-ref module
|
(let ((command-main (module-ref module
|
||||||
(symbol-append 'guix- command))))
|
(symbol-append 'guix- command))))
|
||||||
|
|
Reference in a new issue