kvz / bash3boilerplate

Templates to write better Bash scripts
http://bash3boilerplate.sh
MIT License
2.12k stars 198 forks source link

(osx): homebrew removed `--with-default-names` #123

Closed virgilwashere closed 4 years ago

virgilwashere commented 4 years ago

On Jan 18 2019, homebrew-core removed the option to install coreutils and other common GNU commands --with-default-names.

@kvz, you might want to consider using this logic

if type brew &>/dev/null; then
  HOMEBREW_PREFIX="$(brew --prefix)"
  # add gnubin commands to $PATH
  for d in "${HOMEBREW_PREFIX}"/opt/*/libexec/gnubin; do export PATH=$d:$PATH; done
  # add gnubin manpages to $MANPATH
  # for d in "${HOMEBREW_PREFIX}"/opt/*/libexec/gnuman; do export MANPATH=$d:$MANPATH; done
fi

in https://github.com/kvz/bash3boilerplate/blob/master/test/acceptance.sh#L44-L60

Or possibly promoting it in the FAQ or README, and assuming standard GNU command names.

Personally, homebrew 🍆 the 🐶

Virgil

kvz commented 4 years ago

As far as i understand, the g prefixed bins keep working, which is what we use in the acceptance.sh script?

virgilwashere commented 4 years ago

I needed to account for the OSX G binaries in the travis scripts... or find a way to make homebrew gnu utils the same as Ubuntu. End result is 1 osx if statement for PATH and the rest of the scripts work on both OS

kvz commented 4 years ago

Let's continue this thread in https://github.com/kvz/bash3boilerplate/pull/114

virgilwashere commented 4 years ago

Sure thing. I remember reading I can get a travis environment to be interactive. I'll confirm what we need.