#!/usr/bin/env bash | |
(set -x; brew update;) | |
(set -x; brew cleanup;) | |
(set -x; brew cask cleanup;) | |
red=`tput setaf 1` | |
green=`tput setaf 2` | |
reset=`tput sgr0` | |
casks=( $(brew cask list) ) | |
for cask in ${casks[@]} | |
do | |
version=$(brew cask info $cask | sed -n "s/$cask:\ \(.*\)/\1/p") | |
installed=$(find "/usr/local/Caskroom/$cask" -type d -maxdepth 1 -maxdepth 1 -name "$version") | |
if [[ -z $installed ]]; then | |
echo "${red}${cask}${reset} requires ${red}update${reset}." | |
(set -x; brew cask uninstall $cask --force;) | |
(set -x; brew cask install $cask --force;) | |
else | |
echo "${red}${cask}${reset} is ${green}up-to-date${reset}." | |
fi | |
done |
This comment has been minimized.
This comment has been minimized.
Brilliant, thank you |
This comment has been minimized.
This comment has been minimized.
This is sweet! Thanks! |
This comment has been minimized.
This comment has been minimized.
thanks atais for that script! cheers |
This comment has been minimized.
This comment has been minimized.
Great script. Much appreciated. |
This comment has been minimized.
This comment has been minimized.
It looks like it stopped working. I know it was working before but now it is not working for my anymore. When I run it everything looks ok. I get no errors. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@gasperz I am not sure if that is enough. Current output for
seems that my version is outdated, but... |
This comment has been minimized.
This comment has been minimized.
I've just created a slightly modified version of this script and it seems to do the trick for me: https://gist.github.com/jwadolowski/622e056478e65341820021b659b5938c Additionally it also updates regular |
This comment has been minimized.
This comment has been minimized.
@atais You are correct. It was my mistake. but @jwadolowski solution does work for me. Tested with VirtualBox cask. |
This comment has been minimized.
This comment has been minimized.
Well in the meantime I have raised a question on And got an interesting link: https://github.com/buo/homebrew-cask-upgrade |
This comment has been minimized.
This comment has been minimized.
@jwadolowski I have merged your changes to my gist. Thanks! |
This comment has been minimized.
This comment has been minimized.
There might be an issue with uninstalling the app first, since the download might fail if the network connection is bad, recommending remove the code on L21 since install with --force option would overwrite its ancestor by default. |
This comment has been minimized.
This comment has been minimized.
It is awesome! Thanks. |
This comment has been minimized.
This comment has been minimized.
Thank you! |
This comment has been minimized.
it is an updated version of https://gist.github.com/atais/5d3ec79e67f221cb55b7