Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
moukoublen committed Apr 21, 2024
1 parent 677b8e3 commit 31b6c1e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
9 changes: 9 additions & 0 deletions bin/UpdateOS
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ then
)
fi

if command -v brew &> /dev/null
then
(set -ex
brew update
brew upgrade
brew cleanup
)
fi

# "${DOTFILES_PATH}"/scripts/install-bat
# "${DOTFILES_PATH}"/scripts/install-delta
#"${DOTFILES_PATH}"/scripts/install-dbeaver
Expand Down
33 changes: 17 additions & 16 deletions lib/00-homebrew.bash
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
init-linuxbrew() {
[[ ! -d '/home/linuxbrew/.linuxbrew' ]] && return 0

eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"
if [ -d "${HOMEBREW_PREFIX}/etc/bash_completion.d" ]; then
for rc in "${HOMEBREW_PREFIX}/etc/bash_completion.d"/*; do
if [ -f "${rc}" ]; then
source "${rc}"
fi
done
fi
unset rc
}

case "$(uname)" in

"Darwin")
if [[ ! -d '/opt/homebrew' ]]; then
return 0
fi
[[ ! -d '/opt/homebrew' ]] && return 0
eval "$(/opt/homebrew/bin/brew shellenv)"

if [[ -r "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh" ]]; then
Expand All @@ -13,19 +25,8 @@ case "$(uname)" in
;;

"Linux")
if [ ! -d '/home/linuxbrew/.linuxbrew' ]; then
return 0
fi
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

if [ -d "${HOMEBREW_PREFIX}/etc/bash_completion.d" ]; then
for rc in "${HOMEBREW_PREFIX}/etc/bash_completion.d"/*; do
if [ -f "${rc}" ]; then
source "${rc}"
fi
done
fi
unset rc
[[ "${__DISABLE_LINUXBREW}" == 'true' ]] && return 0
init-linuxbrew
;;

esac

0 comments on commit 31b6c1e

Please sign in to comment.