From c0a2cfb06abee26b1769a67ca5d3978e010c5d0d Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 29 Feb 2024 08:43:54 -0500 Subject: [PATCH] fix: Make this check if brew is installed before trying to run it. (#975) --- dx/usr/etc/zsh/zshrc | 4 +++- dx/usr/share/fish/vendor_conf.d/brew.fish | 2 +- usr/etc/profile.d/brew.sh | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dx/usr/etc/zsh/zshrc b/dx/usr/etc/zsh/zshrc index f0e558d6557..a5da692a40d 100644 --- a/dx/usr/etc/zsh/zshrc +++ b/dx/usr/etc/zsh/zshrc @@ -5,7 +5,9 @@ # if [[ -o interactive ]]; then - eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + if command -v brew >/dev/null 2>&1; then + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + fi fi autoload -U compinit diff --git a/dx/usr/share/fish/vendor_conf.d/brew.fish b/dx/usr/share/fish/vendor_conf.d/brew.fish index 3f9c4f79a61..a42e0b26897 100644 --- a/dx/usr/share/fish/vendor_conf.d/brew.fish +++ b/dx/usr/share/fish/vendor_conf.d/brew.fish @@ -1 +1 @@ -status --is-interactive && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" \ No newline at end of file +command -v brew >/dev/null 2>&1 && status --is-interactive && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" diff --git a/usr/etc/profile.d/brew.sh b/usr/etc/profile.d/brew.sh index 378812aad03..831eb681af7 100644 --- a/usr/etc/profile.d/brew.sh +++ b/usr/etc/profile.d/brew.sh @@ -1 +1 @@ -[[ $- == *i* ]] && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" \ No newline at end of file +[[ $(command -v brew >/dev/null 2>&1) && $- == *i* ]] && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" \ No newline at end of file