Fix fish/zsh completions
fixes mistake in fish/zsh completions.
This commit is contained in:
@@ -26,16 +26,16 @@ class Completion:
|
|||||||
comp_dir = self.share_dir + "/fish/vendor_completions.d/"
|
comp_dir = self.share_dir + "/fish/vendor_completions.d/"
|
||||||
for point in self.entry_points:
|
for point in self.entry_points:
|
||||||
self.env[f"_{point.upper().replace('-', '_')}_COMPLETE"] = "fish_source"
|
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)
|
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"):
|
if self.shell in ("all", "zsh"):
|
||||||
comp_dir = self.share_dir + "/zsh/site-functions/"
|
comp_dir = self.share_dir + "/zsh/site-functions/"
|
||||||
for point in self.entry_points:
|
for point in self.entry_points:
|
||||||
self.env[f"_{point.upper().replace('-', '_')}_COMPLETE"] = "zsh_source"
|
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)
|
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):
|
def uninstall(self):
|
||||||
if self.shell in ("all", "bash"):
|
if self.shell in ("all", "bash"):
|
||||||
@@ -47,12 +47,12 @@ class Completion:
|
|||||||
if self.shell in ("all", "fish"):
|
if self.shell in ("all", "fish"):
|
||||||
comp_dir = self.share_dir + "/fish/vendor_completions.d/"
|
comp_dir = self.share_dir + "/fish/vendor_completions.d/"
|
||||||
for point in self.entry_points:
|
for point in self.entry_points:
|
||||||
if os.path.exists(comp_dir + point):
|
if os.path.exists(comp_dir + point + ".fish"):
|
||||||
os.remove(comp_dir + point)
|
os.remove(comp_dir + point + ".fish")
|
||||||
print(f"Fish completion for {point} removed from {comp_dir}{point}")
|
print(f"Fish completion for {point} removed from {comp_dir}{point}.fish")
|
||||||
if self.shell in ("all", "zsh"):
|
if self.shell in ("all", "zsh"):
|
||||||
comp_dir = self.share_dir + "/zsh/site-functions/"
|
comp_dir = self.share_dir + "/zsh/site-functions/"
|
||||||
for point in self.entry_points:
|
for point in self.entry_points:
|
||||||
if os.path.exists(comp_dir + point):
|
if os.path.exists(comp_dir + "_" + point):
|
||||||
os.remove(comp_dir + point)
|
os.remove(comp_dir + "_" + point)
|
||||||
print(f"Zsh completion for {point} removed from {comp_dir}{point}")
|
print(f"Zsh completion for {point} removed from {comp_dir}_{point}")
|
||||||
|
|||||||
Reference in New Issue
Block a user