Skip to content

Instantly share code, notes, and snippets.

@r3nya r3nya/clean-tweetbot-cache
Last active Aug 29, 2015

Embed
What would you like to do?
#!/usr/bin/env sh
tweetbot_running() {
ps x | grep -v grep | grep Tweetbot > /dev/null
}
clean_tweetbot_cache() {
rm -rf ~/Library/Containers/com.tapbots.TweetbotMac/Data/Library/Caches/com.tapbots.TweetbotMac
}
tell_tweetbot_to() {
osascript -e "tell application \"Tweetbot\" to $1"
}
quit_tweetbot() {
tell_tweetbot_to quit
while tweetbot_running ; do
sleep 0.001
done
}
start_tweetbot() {
tell_tweetbot_to activate
}
if tweetbot_running ; then
quit_tweetbot
clean_tweetbot_cache
start_tweetbot
else
clean_tweetbot_cache
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.