shellenv: silence errors from writing to etc/paths file

Users don't need to see this error. We can just fall back silently
instead.
This commit is contained in:
Carlo Cabrera 2024-08-29 19:12:23 +08:00
parent 04088b3e3c
commit 6cd74705cb
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -26,7 +26,7 @@ homebrew-shellenv() {
if [[ ! -f "${HOMEBREW_PATHS_FILE}" ]]
then
printf '%s/bin\n%s/sbin\n' "${HOMEBREW_PREFIX}" "${HOMEBREW_PREFIX}" >"${HOMEBREW_PATHS_FILE}"
printf '%s/bin\n%s/sbin\n' "${HOMEBREW_PREFIX}" "${HOMEBREW_PREFIX}" >"${HOMEBREW_PATHS_FILE}" 2>/dev/null
fi
if [[ -r "${HOMEBREW_PATHS_FILE}" ]]