Skip to content

Commit 0dae7f0

Browse files
Rudxainakinomyoga
andcommitted
docs(README): avoid double-source in example .bashrc
Co-authored-by: Koichi Murase <[email protected]>
1 parent 236ca37 commit 0dae7f0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ list of operating system distributions, package names, and available versions.
1919
Depending on the package, you may still
2020
need to source it from either `/etc/bashrc` or `~/.bashrc` (or any
2121
other file sourcing those). If you have _only_ bash >= 4.2 installed, you can
22-
do this by simply using:
22+
do this by using:
2323

2424
```bash
25-
# Use bash-completion, if available
26-
[[ $PS1 && -f /usr/share/bash-completion/bash_completion ]] && \
25+
# Use bash-completion, if available, and avoid double-sourcing
26+
[[ $PS1 &&
27+
! ${BASH_COMPLETION_VERSINFO:-} &&
28+
-f /usr/share/bash-completion/bash_completion ]] &&
2729
. /usr/share/bash-completion/bash_completion
2830
```
2931

0 commit comments

Comments
 (0)