diff options
author | Alec Scott <hi@alecbcs.com> | 2024-10-02 15:10:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-03 00:10:56 +0200 |
commit | 9326e9211ca7985209ba8b24153b6e35959e18e5 (patch) | |
tree | 24b4df61832c77ab7625b416bc593cb0bc5d33a6 /var | |
parent | 742e8142cfc264c1e95e7a2141a757a6cfc172e7 (diff) | |
download | spack-9326e9211ca7985209ba8b24153b6e35959e18e5.tar.gz spack-9326e9211ca7985209ba8b24153b6e35959e18e5.tar.bz2 spack-9326e9211ca7985209ba8b24153b6e35959e18e5.tar.xz spack-9326e9211ca7985209ba8b24153b6e35959e18e5.zip |
glow: fix package to install completions and not source dir (#46728)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/glow/package.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/glow/package.py b/var/spack/repos/builtin/packages/glow/package.py index 979d56da20..2c20cfda21 100644 --- a/var/spack/repos/builtin/packages/glow/package.py +++ b/var/spack/repos/builtin/packages/glow/package.py @@ -33,8 +33,18 @@ class Glow(GoPackage): version("1.0.2", sha256="2d98c1e780d750b83d8da094de4c2a999c324021906e6d813b7c75d0320243c8") version("1.0.1", sha256="78d163bea8e6c13fb343f1e3586e93e0392e5052c408a248cc2f0fcc7aa38618") - def install(self, spec, prefix): - mkdirp(prefix.bin) - install("glow", prefix.bin) - mkdirp(prefix.completions) - install_tree(".", prefix.completions) + @run_after("install") + def install_completions(self): + glow = Executable(self.prefix.bin.glow) + + mkdirp(bash_completion_path(self.prefix)) + with open(bash_completion_path(self.prefix) / "glow", "w") as file: + glow("completion", "bash", output=file) + + mkdirp(fish_completion_path(self.prefix)) + with open(fish_completion_path(self.prefix) / "glow.fish", "w") as file: + glow("completion", "fish", output=file) + + mkdirp(zsh_completion_path(self.prefix)) + with open(zsh_completion_path(self.prefix) / "_glow", "w") as file: + glow("completion", "zsh", output=file) |