GNU bug report logs - #45110
[PATCH] gnu: gita: Install shell completions.

Previous Next

Package: guix-patches;

Reported by: Michael Rohleder <mike <at> rohleder.de>

Date: Tue, 8 Dec 2020 01:23:02 UTC

Severity: normal

Tags: patch

Done: Oleg Pykhalov <go.wigust <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Rohleder <mike <at> rohleder.de>
To: guix-patches <at> gnu.org
Cc: Michael Rohleder <mike <at> rohleder.de>
Subject: [PATCH] gnu: gita: Install shell completions.
Date: Tue,  8 Dec 2020 02:22:03 +0100
* gnu/packages/version-control.scm (gita)[arguments]: Add phase
install-shell-completions.
---
 gnu/packages/version-control.scm | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index a3588009c0..95d6c220c0 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -31,6 +31,7 @@
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
 ;;; Copyright © 2020 Vinicius Monego <monego <at> posteo.net>
 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy <at> bioneland.org>
+;;; Copyright © 2020 Michael Rohleder <mike <at> rohleder.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2947,7 +2948,19 @@ 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"))
+                 #t))))))
       (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
-- 
2.29.2





This bug report was last modified 4 years and 164 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.