Skip to content

Commit

Permalink
[homebrew] Cleanup profile, add Brewfile
Browse files Browse the repository at this point in the history
  • Loading branch information
aGHz committed Jun 21, 2024
1 parent 3cb4c19 commit cbc3462
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bash/profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@
[ -n "$PROFILE_DEBUG" ] && echo "--- .profile"
[ -n "$PROFILE_DEBUG" ] && perl -MTime::HiRes=time -e 'printf "~~~ .profile 00: %.9f\n", time'

[ -z "$XDG_CONFIG_HOME" ] && export XDG_CONFIG_HOME="$HOME/.config"

# Initialize $PATH from scratch
if [ -x /usr/libexec/path_helper ]; then
export PATH=""
eval `/usr/libexec/path_helper -s`
else
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
fi

[ -f "${XDG_CONFIG_HOME}/homebrew/homebrew.sh" ] && . "${XDG_CONFIG_HOME}/homebrew/homebrew.sh"

[ -d "$HOME/.local/bin" ] && export PATH="$HOME/.local/bin:$PATH"
[ -d "$HOME/bin" ] && export PATH="$HOME/bin:$PATH"

[ -z "$XDG_CONFIG_HOME" ] && export XDG_CONFIG_HOME="$HOME/.config"

# programmable completion
[ -f /etc/bash_completion ] && ! shopt -oq posix && . /etc/bash_completion
[ -n "$(type -p brew)" ] && [ -f "$(brew --prefix)/etc/bash_completion" ] && . "$(brew --prefix)/etc/bash_completion"

# Ripgrep
export RIPGREP_CONFIG_PATH="$XDG_CONFIG_HOME/rg/ripgreprc"
Expand Down
11 changes: 11 additions & 0 deletions homebrew/Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
tap "homebrew/bundle"
brew "coreutils"
brew "asdf"
brew "bash"
brew "bash-completion"
brew "git"
brew "gnu-tar"
brew "mosh"
brew "ripgrep"
brew "tmux"
brew "vim"
11 changes: 11 additions & 0 deletions homebrew/homebrew.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Homebrew installs in /opt/homebrew on Apple Sillicon and in /usr/local for MacOS Intel
[ -d "/opt/homebrew/bin" ] && export PATH="/opt/homebrew/bin:$PATH"
if [ -n "$(type -p brew)" ]; then
eval "$(brew shellenv)"

# Homebrew coreutils are installed with a `g` prefix so as to not conflict with system utils
[ -d "${HOMEBREW_PREFIX}/opt/coreutils/libexec/gnubin" ] && export PATH="${HOMEBREW_PREFIX}/opt/coreutils/libexec/gnubin:$PATH"
[ -d "${HOMEBREW_PREFIX}/opt/gnu-tar/libexec/gnubin" ] && export PATH="${HOMEBREW_PREFIX}/opt/gnu-tar/libexec/gnubin:$PATH"

[ -f "${HOMEBREW_PREFIX}/etc/bash_completion" ] && . "${HOMEBREW_PREFIX}/etc/bash_completion" # brew install bash-completion
fi

0 comments on commit cbc3462

Please sign in to comment.