File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,18 +11,19 @@ if ! complete -p kubectl &>/dev/null; then
1111fi
1212
1313if ! complete -p oc & > /dev/null; then
14- # Check for oc in common locations
14+ # Check for oc in common locations, prioritizing ~/.local/bin
1515 oc_cmd=" "
16- if command -v oc & > /dev/null; then
17- oc_cmd=" oc"
18- elif [[ -x " $HOME /.local/bin/oc" ]]; then
16+ if [[ -x " $HOME /.local/bin/oc" ]]; then
1917 oc_cmd=" $HOME /.local/bin/oc"
18+ elif command -v oc & > /dev/null; then
19+ oc_cmd=" oc"
2020 elif [[ -x " /usr/local/bin/oc" ]]; then
2121 oc_cmd=" /usr/local/bin/oc"
2222 fi
2323
2424 if [[ -n " $oc_cmd " ]]; then
25- source <( $oc_cmd completion bash 2> /dev/null)
25+ # Load oc completion and ensure it gets registered
26+ eval " $( $oc_cmd completion bash 2> /dev/null) "
2627 echo " Loaded oc completion from: $oc_cmd "
2728 fi
2829fi
You can’t perform that action at this time.
0 commit comments