Skip to content

Instantly share code, notes, and snippets.

@umi-uyura
Created February 17, 2016 06:42
Show Gist options
  • Save umi-uyura/e2ca550826d4a11f3ff2 to your computer and use it in GitHub Desktop.
Save umi-uyura/e2ca550826d4a11f3ff2 to your computer and use it in GitHub Desktop.
Check for updated Homebrew Cask
#!/bin/sh
#
# Check for updated for Casks.
#
HOMEBREW_CASK_ROOT="/opt/homebrew-cask/Caskroom/"
TREE_COMMAND=`which tree`
JQ_COMMAND=`which jq`
if [ "" == $TREE_COMMAND ]; then
echo "tree command is required."
exit
fi
if [ "" == $JQ_COMMAND ]; then
echo "jq command is required."
exit
fi
tree -L 2 -d -f -t --timefmt "%Y/%m/%d %H:%M:%S" -J --noreport $HOMEBREW_CASK_ROOT | jq ".[0].contents | .[] | select(.contents | length > 1) | {name: .name, contents: .contents}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment