[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/03: gnu: exercism: Install shell completions.
From: |
guix-commits |
Subject: |
01/03: gnu: exercism: Install shell completions. |
Date: |
Sat, 1 Oct 2022 17:06:32 -0400 (EDT) |
efraim pushed a commit to branch master
in repository guix.
commit 4b5ac6b226bdf34387ded002647c44a0c63587f8
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Sat Oct 1 23:46:12 2022 +0300
gnu: exercism: Install shell completions.
* gnu/packages/education.scm (exercism)[arguments]: Add a phase to build
and install shell completions.
---
gnu/packages/education.scm | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/education.scm b/gnu/packages/education.scm
index a2607087e5..f16324a2c6 100644
--- a/gnu/packages/education.scm
+++ b/gnu/packages/education.scm
@@ -1065,7 +1065,28 @@ machine, and more.")
(arguments
`(#:import-path "github.com/exercism/cli/exercism"
#:unpack-path "github.com/exercism/cli"
- #:install-source? #f))
+ #:install-source? #f
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'install-completions
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bash (string-append out
"/etc/bash_completion.d/exercism"))
+ (fish (string-append
+ out
"/share/fish/vendor_completions.d/exercism.fish"))
+ (zsh (string-append out
"/share/zsh/site-functions/_exercism")))
+ (mkdir-p (dirname bash))
+ (with-output-to-file bash
+ (lambda ()
+ (invoke (string-append out "/bin/exercism") "completion"
"bash")))
+ (mkdir-p (dirname fish))
+ (with-output-to-file fish
+ (lambda ()
+ (invoke (string-append out "/bin/exercism") "completion"
"fish")))
+ (mkdir-p (dirname zsh))
+ (with-output-to-file zsh
+ (lambda ()
+ (invoke (string-append out "/bin/exercism") "completion"
"zsh")))))))))
(inputs
`(("github.com/blang/semver" ,go-github-com-blang-semver)
("github.com/spf13/cobra" ,go-github-com-spf13-cobra)