Fix fish/zsh completions

fixes mistake in fish/zsh completions.
This commit is contained in:
OMEGARAZER 2022-12-19 17:33:07 -05:00
parent 7cf096012e
commit 2e2dfe671b
No known key found for this signature in database
GPG Key ID: D89925310D306E35

View File

@ -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}")