Skip to content

Commit 3f8b898

Browse files
authored
docs(completions): support other Linux distros (#1543)
1 parent 413ff6d commit 3f8b898

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

runtime/reference/cli/completions.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,16 @@ For example: `deno un` -> <kbd>Tab</kbd> -> `deno uninstall`.
1616

1717
```bash
1818
deno completions bash > deno.bash
19-
sudo mv deno.bash /usr/local/etc/bash_completion.d/
20-
source /usr/local/etc/bash_completion.d/deno.bash
19+
20+
if [ -d "/usr/local/etc/bash_completion.d/" ]; then
21+
sudo mv deno.bash /usr/local/etc/bash_completion.d/
22+
source /usr/local/etc/bash_completion.d/deno.bash
23+
elif [ -d "/usr/share/bash-completion/completions/" ]; then
24+
sudo mv deno.bash /usr/share/bash-completion/completions/
25+
source /usr/share/bash-completion/completions/deno.bash
26+
else
27+
echo "Please move deno.bash to the appropriate bash completions directory"
28+
fi
2129
```
2230

2331
### Configure PowerShell shell completion

0 commit comments

Comments
 (0)