Skip to content

Commit

Permalink
force absolute paths on install of completion scripts #156
Browse files Browse the repository at this point in the history
  • Loading branch information
bckohan committed Dec 31, 2024
1 parent bdb6be5 commit ed2296c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions django_typer/management/commands/shellcompletion.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,14 @@ def manage_script(self) -> t.Union[str, Path]:
# this case as well, but it does complicate the installation for some shell's so we must
# first figure out which mode we are in.
if not self._manage_script:
self._manage_script = get_usage_script()
return self._manage_script
self.manage_script = None # type: ignore
return self._manage_script # type: ignore

@manage_script.setter
def manage_script(self, script: t.Optional[str]):
self._manage_script = get_usage_script(script)
if isinstance(self._manage_script, Path):
self._manage_script = self._manage_script.absolute()

@property
def manage_script_name(self) -> str:
Expand Down

0 comments on commit ed2296c

Please sign in to comment.