mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 15:36:20 -05:00
time-machine: Handle 'git-error' exceptions.
* guix/scripts/pull.scm (with-git-error-handling): Export. * guix/scripts/time-machine.scm (guix-time-machine): Wrap body in 'with-git-error-handling'.
This commit is contained in:
parent
067305977c
commit
d17e012da7
2 changed files with 12 additions and 9 deletions
|
@ -57,6 +57,7 @@ (define-module (guix scripts pull)
|
|||
#:use-module (ice-9 format)
|
||||
#:export (display-profile-content
|
||||
channel-list
|
||||
with-git-error-handling
|
||||
guix-pull))
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,8 @@ (define-module (guix scripts time-machine)
|
|||
#:use-module (guix inferior)
|
||||
#:use-module (guix channels)
|
||||
#:use-module (guix store)
|
||||
#:use-module ((guix scripts pull) #:select (channel-list))
|
||||
#:use-module ((guix scripts pull)
|
||||
#:select (with-git-error-handling channel-list))
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-11)
|
||||
|
@ -94,11 +95,12 @@ (define (parse-args args)
|
|||
|
||||
(define (guix-time-machine . args)
|
||||
(with-error-handling
|
||||
(let* ((opts (parse-args args))
|
||||
(channels (channel-list opts))
|
||||
(command-line (assoc-ref opts 'exec)))
|
||||
(when command-line
|
||||
(let* ((directory (with-store store
|
||||
(cached-channel-instance store channels)))
|
||||
(executable (string-append directory "/bin/guix")))
|
||||
(apply execl (cons* executable executable command-line)))))))
|
||||
(with-git-error-handling
|
||||
(let* ((opts (parse-args args))
|
||||
(channels (channel-list opts))
|
||||
(command-line (assoc-ref opts 'exec)))
|
||||
(when command-line
|
||||
(let* ((directory (with-store store
|
||||
(cached-channel-instance store channels)))
|
||||
(executable (string-append directory "/bin/guix")))
|
||||
(apply execl (cons* executable executable command-line))))))))
|
||||
|
|
Loading…
Reference in a new issue