Skip to content

Commit df53bda

Browse files
committed
fix: add rancher bin to path, to override container utilities
1 parent 55cfa94 commit df53bda

File tree

2 files changed

+29
-19
lines changed

2 files changed

+29
-19
lines changed

shell/paths.sh

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# PATH / MANPATH exports
44
# Defines the $PATH export/variable for shell environments.
55

6-
type "find_files" &> /dev/null || . "$DOTFILES/functions/find_files"
6+
type "find_files" &>/dev/null || . "$DOTFILES/functions/find_files"
77

88
#-------------------------------------------------------------------------------
99
# BINARIES/SCRIPTS
@@ -31,23 +31,34 @@ export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
3131

3232
# LOAD DOTFILES PATHS:
3333
# for file in ~/.dotfiles/{git,system}/path.sh; do
34-
for _file in $(find_files "$DOTFILES" 'path.sh' 2); do . "$_file"; done; unset _file
35-
36-
# CUSTOM/USER PATHS
37-
# `~/.path` can be used to extend `$PATH`.
38-
[[ -f "$HOME/.path" ]] && . "$HOME/.path"
34+
for _file in $(find_files "$DOTFILES" 'path.sh' 2); do . "$_file"; done
35+
unset _file
3936

4037
#-------------------------------------------------------------------------------
4138
# HOMEBREW
4239
#-------------------------------------------------------------------------------
4340

4441
# Homebrew init.
45-
[[ -f "$DOTFILES/brew/init_install.sh" ]] && . "$DOTFILES/brew/init_install.sh" \
46-
&& _init_homebrew
42+
[[ -f "$DOTFILES/brew/init_install.sh" ]] && . "$DOTFILES/brew/init_install.sh" &&
43+
_init_homebrew
4744

4845
# Homebrew path must come first to override system binaries.
4946
export PATH="${HOMEBREW_PREFIX:-/usr/local}/bin:$PATH"
5047

48+
#-------------------------------------------------------------------------------
49+
# RANCHER
50+
#-------------------------------------------------------------------------------
51+
52+
# Rancher - finally, so Rancher can control docker, kubectl, helm, etc.
53+
[[ -d "$HOME/.rd/bin" ]] && export PATH="$HOME/.rd/bin:$PATH"
54+
55+
#-------------------------------------------------------------------------------
56+
# CUSTOM/USER PATHS
57+
#-------------------------------------------------------------------------------
58+
59+
# `~/.path` can be used to extend `$PATH`.
60+
[[ -f "$HOME/.path" ]] && . "$HOME/.path"
61+
5162
#-------------------------------------------------------------------------------
5263
# HELP DOCS/MANUALS
5364
#-------------------------------------------------------------------------------
@@ -61,7 +72,7 @@ export PATH="${HOMEBREW_PREFIX:-/usr/local}/bin:$PATH"
6172
# CLEANUP PATH, MANPATH - Ensure arrays do not contain duplicates.
6273
#-------------------------------------------------------------------------------
6374

64-
if type "awk" &> /dev/null; then
75+
if type "awk" &>/dev/null; then
6576
PATH=$(echo -n "$PATH" | awk -v RS=: '{ if (!arr[$0]++) {printf("%s%s",!ln++?"":":",$0)}}')
6677
export PATH
6778

system/path.sh

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#
33
# PATH inclusions
44

5-
[[ ! -d "${DOTFILES:-}" ]] && DOTFILES=$( cd "${BASH_SOURCE%/*}/.." && pwd )
5+
[[ ! -d "${DOTFILES:-}" ]] && DOTFILES=$(cd "${BASH_SOURCE%/*}/.." && pwd)
66

77
# shellcheck disable=SC1091
8-
type "find_files" &> /dev/null || . "$DOTFILES/functions/find_files"
8+
type "find_files" &>/dev/null || . "$DOTFILES/functions/find_files"
99

1010
_brewd="${HOMEBREW_PREFIX:-/usr/local}"
1111

@@ -58,7 +58,7 @@ _gitd="$_brewd/opt/git"
5858

5959
_golangd="$_brewd/opt/golang"
6060
_gohomed="$HOME/go"
61-
if type "go" &> /dev/null; then
61+
if type "go" &>/dev/null; then
6262
mkdir -p "$_gohomed"/{bin,src,pkg}
6363
GOPATH="$_gohomed"
6464
[[ -d "$_golangd/libexec" ]] && GOROOT="$_golangd/libexec"
@@ -75,8 +75,8 @@ _javad="$_brewd/opt/openjdk"
7575
_jvmd="/Library/Java/JavaVirtualMachines"
7676
if [[ -d "$_javad/bin" ]]; then
7777
# For the system Java wrappers to find this JDK, symlink it with:
78-
if [[ -d "$_jvmd" ]] && [[ ! -e "$_jvmd/openjdk.jdk" ]] \
79-
&& [[ -e "$_javad/libexec/openjdk.jdk" ]]; then
78+
if [[ -d "$_jvmd" ]] && [[ ! -e "$_jvmd/openjdk.jdk" ]] &&
79+
[[ -e "$_javad/libexec/openjdk.jdk" ]]; then
8080
sudo ln -sfn "$_javad/libexec/openjdk.jdk" "$_jvmd/openjdk.jdk"
8181
fi
8282
# openjdk is keg-only, which means it was not symlinked into $(brew --prefix),
@@ -125,8 +125,7 @@ if [[ -d "$_rubyd/bin" ]]; then
125125
# For pkg-config to find ruby you may need to set:
126126
[[ -d "$_rubyd/lib/pkgconfig" ]] && PKG_CONFIG_PATH="$_rubyd/lib/pkgconfig"
127127
# By default, binaries installed by gem will be placed into:
128-
for _file in $(find_files "${HOMEBREW_PREFIX:-}/lib/ruby/gems" 'bin' 2 'd')
129-
do
128+
for _file in $(find_files "${HOMEBREW_PREFIX:-}/lib/ruby/gems" 'bin' 2 'd'); do
130129
PATH="$_file:$PATH"
131130
done
132131
fi
@@ -161,7 +160,7 @@ _terrad="$_brewd/opt/terraform"
161160
# Yarn
162161
################################################################################
163162

164-
type "yarn" &> /dev/null && PATH="$(yarn global bin):$PATH"
163+
type "yarn" &>/dev/null && PATH="$(yarn global bin):$PATH"
165164

166165
################################################################################
167166
# Homebrew
@@ -170,8 +169,8 @@ type "yarn" &> /dev/null && PATH="$(yarn global bin):$PATH"
170169
# Add Linuxbrew PATHs (to your .bashrc or .zshrc):
171170
_lbrewd="$HOME/.linuxbrew"
172171
if [[ -d "$_lbrewd" ]]; then
173-
PATH="$_lbrewd/bin:$PATH"
174-
MANPATH="$_lbrewd/share/man:$MANPATH"
172+
PATH="$_lbrewd/bin:$PATH"
173+
MANPATH="$_lbrewd/share/man:$MANPATH"
175174
INFOPATH="$_lbrewd/share/info:$INFOPATH"
176175
fi
177176

0 commit comments

Comments
 (0)