mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
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 @@ (define (run-guix-command command . args)
|
|||
"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))))
|
||||
|
|
Loading…
Reference in a new issue