-
-
Notifications
You must be signed in to change notification settings - Fork 11k
Description
Hi,
We recently added set -e in our CI script. We had something like:
#!/usr/bin/env bash
set -e
PACKAGES="cmake pkg-config fftw libogg libvorbis libsndfile libsamplerate jack sdl stk portaudio node fltk"
brew install $PACKAGESWith set -e, it failed because brew returned a non-zero exit code for already installed packages. So we had to do:
#!/usr/bin/env bash
set -e
PACKAGES="cmake pkg-config fftw libogg libvorbis libsndfile libsamplerate jack sdl stk portaudio node fltk"
# removing already installed packages from the list
for p in $(brew list); do
PACKAGES=${PACKAGES//$p/}
done;
brew install $PACKAGESBut it's ugly and buggy. E.g. we used to have pkgconfig, so the string replacement didn't work. It now works cause we replaced it by pkg-config as it is in brew list output.
So, I'd like an option like: brew install --if-not-installed $PACKAGES which won't return a non-zero exit code if $PACKAGES contains already installed packages.
What do you think about it ? I wish i could implement it myself, but I don't know ruby and I'm not even a brew user so probably not the best option. I'm sure someone knowing ruby and brew could do this really quickly as it doesn't seem hard.