checkDependencies now checks gems and mac apps via homebrew casks.

This commit is contained in:
Nathaniel Landau
2015-05-28 09:02:05 -04:00
parent 289d9ba865
commit a71c77949c
4 changed files with 62 additions and 42 deletions

View File

@@ -73,6 +73,12 @@ hasCasks () {
fi
}
# My preferred installation of FFMPEG
install-ffmpeg () {
if [ ! $(type -P "ffmpeg") ]; then
brew install ffmpeg --with-faac --with-fdk-aac --with-ffplay --with-fontconfig --with-freetype --with-libcaca --with-libass --with-frei0r --with-libass --with-libbluray --with-libcaca --with-libquvi --with-libvidstab --with-libsoxr --with-libssh --with-libvo-aacenc --with-libvidstab --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-openssl --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools --with-webp --with-x265
fi
}
# doInstall
# ------------------------------------------------------
@@ -125,25 +131,39 @@ function to_install() {
function doInstall () {
list="$(to_install "${RECIPES[*]}" "$($LISTINSTALLED)")"
if [[ "${list}" ]]; then
seek_confirmation "Confirm each install before running?"
seek_confirmation "Confirm each package before installing?"
if is_confirmed; then
for item in ${list[@]}
do
seek_confirmation "Install ${item}?"
if is_confirmed; then
notice "Installing ${item}"
${INSTALLCOMMAND} ${item}
# FFMPEG takes additional flags
if [[ "${item}" = "ffmpeg" ]]; then
install-ffmpeg
else
${INSTALLCOMMAND} ${item}
fi
fi
done
else
for item in ${list[@]}
do
notice "Installing ${item}"
${INSTALLCOMMAND} ${item}
# FFMPEG takes additional flags
if [[ "${item}" = "ffmpeg" ]]; then
install-ffmpeg
else
${INSTALLCOMMAND} ${item}
fi
done
fi
else
notice "Nothing to install. You've already installed all your recipes."
# only print notice when not checking dependencies via another script
if [ -z "$homebrewDependencies" ] && [ -z "$caskDependencies" ] && [ -z "$gemDependencies" ]; then
notice "Nothing to install. You've already installed all your recipes."
fi
fi
}

View File

@@ -335,27 +335,32 @@ function help () {
# -----------------------------------
function checkDependencies() {
# Check bashDependencies
for dependency in "${homebrewDependencies[@]}"; do
if type_not_exists "${dependency}"; then
# Attempt to install necessary packages via Homebrew if invoked on a Mac
if [[ "${OSTYPE}" =~ ^darwin ]]; then
seek_confirmation "We can not proceed without '${dependency}'. Would you like to install it via Homebrew?"
if is_confirmed; then
hasHomebrew # Installs Homebrew and all dependencies if needed.
if [[ "${dependency}" == "ffmpeg" ]]; then # install ffmpeg with all packages
brew install ffmpeg --with-faac --with-fdk-aac --with-ffplay --with-fontconfig --with-freetype --with-libcaca --with-libass --with-frei0r --with-libass --with-libbluray --with-libcaca --with-libquvi --with-libvidstab --with-libsoxr --with-libssh --with-libvo-aacenc --with-libvidstab --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-openssl --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools --with-webp --with-x265
else
brew install "${dependency}" #install anything else needed
fi
else
die "Can not proceed without '${dependency}'. Please install it before running this script."
fi
else
die "Can not proceed without '${dependency}'. Please install it before running this script."
fi # /OStype
fi # not type $dependency
done
if [ -n "$homebrewDependencies" ]; then
LISTINSTALLED="brew list"
INSTALLCOMMAND="brew install"
RECIPES="${homebrewDependencies}"
# Invoke functions from setupScriptFunctions.sh
hasHomebrew
doInstall
fi
if [ -n "$caskDependencies" ]; then
LISTINSTALLED="brew cask list"
INSTALLCOMMAND="brew cask install --appdir=/Applications"
RECIPES="${caskDependencies}"
# Invoke functions from setupScriptFunctions.sh
hasHomebrew
hasCasks
doInstall
fi
if [ -n "$gemDependencies" ]; then
LISTINSTALLED="gem list | awk '{print $1}'"
INSTALLCOMMAND="gem install"
RECIPES="${gemDependencies}"
# Invoke functions from setupScriptFunctions.sh
doInstall
fi
}
# pauseScript