Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions private_dot_bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ if [[ -d "/usr/local/bin" ]]; then
fi

if [[ -e "/opt/homebrew/bin/brew" ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [[ -e "/usr/local/bin/brew" ]]; then
eval "$(/usr/local/bin/brew shellenv)"
eval "$(/opt/homebrew/bin/brew shellenv bash)"
fi
Comment thread
lgw4 marked this conversation as resolved.

# Import files from $HOME/.bashrc.d
Expand Down
14 changes: 9 additions & 5 deletions private_dot_bashrc.d/private_tools/private_golang.bash.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck shell=bash
# shellcheck disable=SC2103,SC2155,SC2164
if [[ -d "$HOME/.goenv" ]]; then
export GOENV_ROOT="$HOME/.goenv"
fi
export GOENV_ROOT="${GOENV_ROOT:-$HOME/.goenv}"

{{- if (and (eq .chezmoi.os "linux") (or (eq .chezmoi.osRelease.id "debian") (eq .chezmoi.osRelease.id "ubuntu"))) }}
if [[ -n "$GOENV_ROOT" ]] && [[ -f "$GOENV_ROOT/bin/goenv" ]]; then
Expand All @@ -11,8 +9,14 @@ fi
{{- end }}

if command -v goenv >/dev/null 2>&1; then
eval "$(goenv init -)"
path_prepend "$GOENV_ROOT/shims"
if [[ -d "$GOENV_ROOT/shims" ]]; then
path_prepend "$GOENV_ROOT/shims"
fi
goenv() {
unset -f goenv
eval "$(command goenv init -)"
goenv "$@"
}
fi

if [[ -d "$HOME/Developer/go" ]]; then
Expand Down
13 changes: 9 additions & 4 deletions private_dot_bashrc.d/private_tools/private_node.bash.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ if [[ -d "$HOMEBREW_PREFIX/share/npm/bin" ]]; then
path_append "$HOMEBREW_PREFIX/share/npm/bin"
fi

if [[ -d "$HOME/.nodenv" ]]; then
export NODENV_ROOT="$HOME/.nodenv"
fi
export NODENV_ROOT="${NODENV_ROOT:-$HOME/.nodenv}"

{{- if (and (eq .chezmoi.os "linux") (or (eq .chezmoi.osRelease.id "debian") (eq .chezmoi.osRelease.id "ubuntu"))) }}
if [[ -n "$NODENV_ROOT" ]] && [[ -f "$NODENV_ROOT/bin/nodenv" ]]; then
Expand All @@ -15,5 +13,12 @@ fi
{{- end }}

if command -v nodenv >/dev/null 2>&1; then
eval "$(nodenv init -)"
if [[ -d "$NODENV_ROOT/shims" ]]; then
path_prepend "$NODENV_ROOT/shims"
fi
nodenv() {
unset -f nodenv
eval "$(command nodenv init -)"
nodenv "$@"
}
fi
13 changes: 9 additions & 4 deletions private_dot_bashrc.d/private_tools/private_ruby.bash.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck shell=bash
# shellcheck disable=SC2103,SC2155,SC2164
if [[ -d "$HOME/.rbenv" ]]; then
export RBENV_ROOT="$HOME/.rbenv"
fi
export RBENV_ROOT="${RBENV_ROOT:-$HOME/.rbenv}"

{{- if (and (eq .chezmoi.os "linux") (or (eq .chezmoi.osRelease.id "debian") (eq .chezmoi.osRelease.id "ubuntu"))) }}
if [[ -n "$RBENV_ROOT" ]] && [[ -f "$RBENV_ROOT/bin/rbenv" ]]; then
Expand All @@ -11,5 +9,12 @@ fi
{{- end }}

if command -v rbenv >/dev/null 2>&1; then
eval "$(rbenv init -)"
if [[ -d "$RBENV_ROOT/shims" ]]; then
path_prepend "$RBENV_ROOT/shims"
fi
rbenv() {
unset -f rbenv
eval "$(command rbenv init -)"
rbenv "$@"
}
fi
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if test -d "/usr/local/bin"
end
{{ if eq .chezmoi.os "darwin" }}
if test -x "/opt/homebrew/bin/brew"
eval "$(/opt/homebrew/bin/brew shellenv)"
eval "$(/opt/homebrew/bin/brew shellenv fish)"
end

if test -n "$HOMEBREW_PREFIX"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
if test -d "$HOME/.goenv"
set -x GOENV_ROOT $HOME/.goenv
end
set -q GOENV_ROOT; or set -x GOENV_ROOT $HOME/.goenv

{{- if (and (eq .chezmoi.os "linux") (or (eq .chezmoi.osRelease.id "debian") (eq .chezmoi.osRelease.id "ubuntu"))) }}
if test -n "$GOENV_ROOT" -a -f "$GOENV_ROOT/bin/goenv"
Expand All @@ -10,8 +8,14 @@ end

if type -q goenv && status --is-interactive
set -x GOENV_PATH_ORDER front
goenv init - fish | source
fish_add_path -mpP $GOENV_ROOT/shims
if test -d "$GOENV_ROOT/shims"
fish_add_path -mpP $GOENV_ROOT/shims
end
function goenv
functions -e goenv
goenv init - fish | source
goenv $argv
end
end

if test -d "$HOME/Developer/go"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ if test -d "$HOMEBREW_PREFIX/share/npm/bin"
end
{{- end }}

if test -d "$HOME/.nodenv"
set -x NODENV_ROOT $HOME/.nodenv
end
set -q NODENV_ROOT; or set -x NODENV_ROOT $HOME/.nodenv

{{- if (and (eq .chezmoi.os "linux") (or (eq .chezmoi.osRelease.id "debian") (eq .chezmoi.osRelease.id "ubuntu"))) }}
if test -n "$NODENV_ROOT" -a -f "$NODENV_ROOT/bin/nodenv"
Expand All @@ -15,8 +13,15 @@ end
{{- end }}

if type -q nodenv && status --is-interactive
nodenv init - fish | source
if test -d "$NODENV_ROOT/shims"
fish_add_path -mpP $NODENV_ROOT/shims
end
{{- if eq .chezmoi.os "darwin" }}
set -x NODE_BUILD_DEFINITIONS "$HOMEBREW_PREFIX/opt/node-build-update-defs/share/node-build"
{{- end }}
function nodenv
functions -e nodenv
nodenv init - fish | source
nodenv $argv
end
end
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
if test -d "$HOME/.rbenv"
set -x RBENV_ROOT $HOME/.rbenv
end
set -q RBENV_ROOT; or set -x RBENV_ROOT $HOME/.rbenv

{{- if (and (eq .chezmoi.os "linux") (or (eq .chezmoi.osRelease.id "debian") (eq .chezmoi.osRelease.id "ubuntu"))) }}
if test -n "$RBENV_ROOT" -a -f "$RBENV_ROOT/bin/rbenv"
Expand All @@ -9,7 +7,14 @@ end
{{- end }}

if type -q rbenv && status --is-interactive
rbenv init - fish | source
set -l rbenv_commands (rbenv commands)
complete -f -c rbenv -n "not __fish_seen_subcommand_from $rbenv_commands" -a update -d 'Update rbenv and rbenv plugins'
if test -d "$RBENV_ROOT/shims"
fish_add_path -mpP $RBENV_ROOT/shims
end
function rbenv
functions -e rbenv
rbenv init - fish | source
set -l rbenv_commands (rbenv commands)
complete -f -c rbenv -n "not __fish_seen_subcommand_from $rbenv_commands" -a update -d 'Update rbenv and rbenv plugins'
rbenv $argv
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,14 @@ if type -q op
function op-signin -d "Sign in to 1Password CLI"
eval (op signin --account {{ onepasswordRead "op://Private/1Password CLI Account Name/notesPlain" }})
end
op completion fish | source
set -l _op_completion ~/.config/fish/completions/op.fish
set -l _op_bin (command -v op)
if not test -f $_op_completion; or test $_op_bin -nt $_op_completion
set -l _op_tmp (mktemp)
if op completion fish > $_op_tmp
mv $_op_tmp $_op_completion
else
rm -f $_op_tmp
end
end
end
2 changes: 1 addition & 1 deletion private_dot_zprofile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Set PATH, MANPATH, etc., for Homebrew.
eval "$(/opt/homebrew/bin/brew shellenv)"
eval "$(/opt/homebrew/bin/brew shellenv zsh)"
export HOMEBREW_CASK_OPTS="--appdir=~/Applications"