gnu: gita: Install shell completions.
authorMichael Rohleder <mike@rohleder.de>
Tue, 8 Dec 2020 01:22:03 +0000 (02:22 +0100)
committerOleg Pykhalov <go.wigust@gmail.com>
Tue, 8 Dec 2020 05:09:21 +0000 (08:09 +0300)
* gnu/packages/version-control.scm (gita)[arguments]: Add phase
install-shell-completions.

Signed-off-by: Oleg Pykhalov <go.wigust@gmail.com>
gnu/packages/version-control.scm

index a358800..8504c8b 100644 (file)
@@ -31,6 +31,7 @@
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
+;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2947,7 +2948,18 @@ defects faster.")
                (add-installed-pythonpath inputs outputs)
                (invoke (string-append (assoc-ref inputs "python-pytest")
                                       "/bin/pytest")
-                       "-vv" "tests"))))))
+                       "-vv" "tests")))
+           (add-after 'install 'install-shell-completions
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (bash-completion (string-append out "/etc/bash_completion.d"))
+                      (zsh-completion (string-append out "/etc/zsh/site-functions")))
+                 (mkdir-p bash-completion)
+                 (copy-file ".gita-completion.bash"
+                            (string-append bash-completion "/gita"))
+                 (mkdir-p zsh-completion)
+                 (copy-file ".gita-completion.zsh"
+                            (string-append zsh-completion "/_gita"))))))))
       (home-page "https://github.com/nosarthur/gita")
       (synopsis "Command-line tool to manage multiple Git repos")
       (description "This package provides a command-line tool to manage