Skip to content

Commit

Permalink
brew-cask is now an external command.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Dec 10, 2015
1 parent f67b611 commit c2aa9a2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
4 changes: 1 addition & 3 deletions .sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ install_xcode

install_brew
install_brew_taps
upgrade_brew_packages
install_brew_packages
install_brew_cask
install_brew_formulae

install_ruby_gems
install_npm_packages
Expand Down
26 changes: 15 additions & 11 deletions include/0.2-brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ brew_install() {
if [ -z "${name}" ]; then
OIFS=$IFS
IFS=';'
for caskname in $(brew-cask _stanza name "${cask}" | sed 's/", "/\;/g' | tr -d '["]'); do
for caskname in $(brew cask _stanza name "${cask}" | sed 's/", "/\;/g' | tr -d '["]'); do
name="${caskname}"
done
IFS=$OIFS
Expand All @@ -60,8 +60,8 @@ brew_install() {
echo -b "Installing ${name}"

mkdir -p "${appdir}"
brew-cask uninstall "${cask}" --force &>/dev/null
brew-cask install "${cask}" --force \
brew cask uninstall "${cask}" --force &>/dev/null
brew cask install "${cask}" --force \
--appdir="${appdir}" \
--prefpanedir=/Library/PreferencePanes \
--qlplugindir=/Library/QuickLook \
Expand All @@ -70,7 +70,7 @@ brew_install() {
if [ "${open}" == true ]; then
IFS=';'

local apps=($(brew-cask _stanza app "${cask}" | sed 's/", "/\;/g' | tr -d '["]'))
local apps=($(brew cask _stanza app "${cask}" | sed 's/", "/\;/g' | tr -d '["]'))

if [ -z "${apps}" ]; then
apps="${name}"
Expand Down Expand Up @@ -137,7 +137,7 @@ install_brew_taps() {

# Upgrade Hombrew Packages

upgrade_brew_packages() {
upgrade_brew_formulae() {

if type brew &>/dev/null; then
echo -b 'Upgrading existing Homebrew packages …'
Expand All @@ -151,7 +151,9 @@ upgrade_brew_packages() {

# Install Homebrew Packages

install_brew_packages() {
install_brew_formulae() {

upgrade_brew_formulae

local brew_packages

Expand Down Expand Up @@ -183,7 +185,7 @@ install_brew_packages() {

# Install Homebrew Cask

install_brew_cask() {
fix_caskroom_permissions() {

local brew_packages

Expand All @@ -201,19 +203,21 @@ install_brew_cask() {
sudo chown -R root:admin /Library/LaunchAgents /Library/LaunchDaemons /Library/PreferencePanes /Library/QuickLook /Library/Screen\ Savers
sudo chmod -R ug=rwx,o=rx /Library/LaunchAgents /Library/LaunchDaemons /Library/PreferencePanes /Library/QuickLook /Library/Screen\ Savers

brew_install -p brew-cask -n 'Homebrew Cask'

fi
}


# Install Homebrew Casks

install_brew_cask_apps() {

fix_caskroom_permissions

local brew_casks

if brew_casks=$(brew-cask ls); then
if brew_casks=$(brew cask ls); then

brew uninstall --force brew-cask

brew_install -c a-better-finder-rename
brew_install -oc reitermarkus/tap/adobe-creative-cloud -n 'Creative Cloud'
Expand Down Expand Up @@ -290,7 +294,7 @@ brew_cleanup() {

echo -r 'Emptying Homebrew cache …'
brew cleanup --force
brew-cask cleanup
brew cask cleanup
rm -rfv "$(brew --cache)/*" | xargs printf "Removing: %s\n"

fi
Expand Down

0 comments on commit c2aa9a2

Please sign in to comment.