Skip to content

Commit

Permalink
Do not overwrite existing dotfile in user directory
Browse files Browse the repository at this point in the history
  • Loading branch information
kislyuk committed Mar 22, 2023
1 parent 5df4c6e commit 9c4f893
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/activate-global-python-argcomplete
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ elif args.user:
' using "activate-global-python-argcomplete --dest=- > completions-dir/_python-argcomplete".',
file=sys.stderr,
)
user_destination = os.path.expanduser("~/.bash_completion")
if os.path.exists(user_destination):
parser.error(
f'Bash user completion configuration file {user_destination} already exists. Please remove it and try '
f'again, or use "activate-global-python-argcomplete --dest=- >> {user_destination}".'
)
destinations.append(os.path.expanduser("~/.bash_completion"))
else:
destinations.append(f"{get_zsh_system_dir()}/_python-argcomplete")
Expand Down

0 comments on commit 9c4f893

Please sign in to comment.