Skip to content

Commit

Permalink
Update _completion_shared.py
Browse files Browse the repository at this point in the history
Wrap quotes around `completion_path` variable to solve potential issues from whitespace in the path name. Eg. "~/.bash_completions/file name.sh"
  • Loading branch information
bufferbit authored Dec 28, 2023
1 parent 3a7264c commit 2dd8607
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion typer/_completion_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def install_bash(*, prog_name: str, complete_var: str, shell: str) -> Path:
rc_content = ""
if rc_path.is_file():
rc_content = rc_path.read_text()
completion_init_lines = [f"source {completion_path}"]
completion_init_lines = [f'source "{completion_path}"']
for line in completion_init_lines:
if line not in rc_content: # pragma: nocover
rc_content += f"\n{line}"
Expand Down

0 comments on commit 2dd8607

Please sign in to comment.