From 2e2dfe671b78b00c695957ee0ea1844afb5fe446 Mon Sep 17 00:00:00 2001 From: OMEGARAZER <869111+OMEGARAZER@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:33:07 -0500 Subject: [PATCH] Fix fish/zsh completions fixes mistake in fish/zsh completions. --- bdfr/completion.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bdfr/completion.py b/bdfr/completion.py index 8f4f122..fac944f 100644 --- a/bdfr/completion.py +++ b/bdfr/completion.py @@ -26,16 +26,16 @@ class Completion: comp_dir = self.share_dir + "/fish/vendor_completions.d/" for point in self.entry_points: self.env[f"_{point.upper().replace('-', '_')}_COMPLETE"] = "fish_source" - with open(comp_dir + point, "w") as file: + with open(comp_dir + point + ".fish", "w") as file: file.write(subprocess.run([point], env=self.env, capture_output=True, text=True).stdout) - print(f"Fish completion for {point} written to {comp_dir}{point}") + print(f"Fish completion for {point} written to {comp_dir}{point}.fish") if self.shell in ("all", "zsh"): comp_dir = self.share_dir + "/zsh/site-functions/" for point in self.entry_points: self.env[f"_{point.upper().replace('-', '_')}_COMPLETE"] = "zsh_source" - with open(comp_dir + point, "w") as file: + with open(comp_dir + "_" + point, "w") as file: file.write(subprocess.run([point], env=self.env, capture_output=True, text=True).stdout) - print(f"Zsh completion for {point} written to {comp_dir}{point}") + print(f"Zsh completion for {point} written to {comp_dir}_{point}") def uninstall(self): if self.shell in ("all", "bash"): @@ -47,12 +47,12 @@ class Completion: if self.shell in ("all", "fish"): comp_dir = self.share_dir + "/fish/vendor_completions.d/" for point in self.entry_points: - if os.path.exists(comp_dir + point): - os.remove(comp_dir + point) - print(f"Fish completion for {point} removed from {comp_dir}{point}") + if os.path.exists(comp_dir + point + ".fish"): + os.remove(comp_dir + point + ".fish") + print(f"Fish completion for {point} removed from {comp_dir}{point}.fish") if self.shell in ("all", "zsh"): comp_dir = self.share_dir + "/zsh/site-functions/" for point in self.entry_points: - if os.path.exists(comp_dir + point): - os.remove(comp_dir + point) - print(f"Zsh completion for {point} removed from {comp_dir}{point}") + if os.path.exists(comp_dir + "_" + point): + os.remove(comp_dir + "_" + point) + print(f"Zsh completion for {point} removed from {comp_dir}_{point}")