Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Contents/MacOS/apps/android-studio
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash -x

#
# Android Studio
#
app_name="Android Studio"

move_android_studio_cache()
{
close_app "Android Studio"
echo "moving Android Studio cache";
if [ -d "/Applications/Android Studio.app" ]; then
# make a backup of config - will need it when uninstalling
cp -f /Applications/Android\ Studio.app/Contents/bin/idea.properties /Applications/Android\ Studio.app/Contents/bin/idea.properties.back
# Idea will create those dirs
echo "idea.system.path=${USERRAMDISK}/AndroidStudio" >> /Applications/Android\ Studio.app/Contents/bin/idea.properties
echo "idea.log.path=${USERRAMDISK}/AndroidStudio/logs" >> /Applications/Android\ Studio.app/Contents/bin/idea.properties
echo "Moved Android cache."
fi
}
22 changes: 22 additions & 0 deletions Contents/MacOS/apps/appcode
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# AppCode
#

app_name="AppCode"

move_appcode_cache()
{
if [ -d "/Applications/AppCode.app" ]; then
if user_response "I found AppCode. Do you want me to move its cache?" ; then
echo "moving AppCode cache";
close_app "AppCode"
# make a backup of config - will need it when uninstalling
cp -f /Applications/AppCode.app/Contents/bin/idea.properties /Applications/AppCode.app/Contents/bin/idea.properties.back
# Need to create those dirs
echo "idea.system.path=${USERRAMDISK}/AppCode" >> /Applications/AppCode.app/Contents/bin/idea.properties
echo "idea.log.path=${USERRAMDISK}/AppCode/logs" >> /Applications/AppCode.app/Contents/bin/idea.properties
mkdir -p ${USERRAMDISK}/AppCode/logs
echo "Moved AppCode cache."
fi
fi
}
15 changes: 15 additions & 0 deletions Contents/MacOS/apps/chrome-canary
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@


app_name="Chrome Canary"

move_chrome_chanary_cache()
{
if [ -d "/Users/${USER}/Library/Caches/Google/Chrome Canary" ]; then
if user_response "I found Chrome Canary. Do you want move its cache?"; then
close_app "Chrome Canary"
/bin/rm -rf ~/Library/Caches/Google/Chrome\ Canary/*
/bin/mkdir -p ${USERRAMDISK}/Google/Chrome\ Canary/Default
/bin/ln -s ${USERRAMDISK}/Google/Chrome\ Canary/Default ~/Library/Caches/Google/Chrome\ Canary/Default
fi
fi
}
21 changes: 21 additions & 0 deletions Contents/MacOS/apps/clion
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Clion
#

app_name="Clion"

move_clion_cache()
{
if [ -d "/Applications/Clion.app" ]; then
if user_response "I found CLion. Do you want me to move its cache?" ; then
echo "moving Clion cache";
close_app "Clion"
# make a backup of config - will need it when uninstalling
cp -f /Applications/Clion.app/Contents/bin/idea.properties /Applications/Clion.app/Contents/bin/idea.properties.back
# Idea will create those dirs
echo "idea.system.path=${USERRAMDISK}/CLion" >> /Applications/Clion.app/Contents/bin/idea.properties
echo "idea.log.path=${USERRAMDISK}/Clion/logs" >> /Applications/Clion.app/Contents/bin/idea.properties
echo "Moved Clion cache."
fi
fi
}
26 changes: 26 additions & 0 deletions Contents/MacOS/apps/google-chrome
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

#
# Google Chrome Cache
#

app_name="Google Chrome"

move_chrome_cache()
{
if [ -d "/Users/${USER}/Library/Caches/Google/Chrome" ]; then
if user_response "I found chrome. Do you want me to move its cache?" ; then
close_app "Google Chrome"
/bin/mkdir -p /tmp/Google/Chrome
/bin/mv ~/Library/Caches/Google/Chrome/* /tmp/Google/Chrome/
/bin/mkdir -pv ${USERRAMDISK}/Google/Chrome/Default
/bin/mv /tmp/Google/Chrome/ ${USERRAMDISK}/Google/Chrome
/bin/ln -v -s -f ${USERRAMDISK}/Google/Chrome/Default ~/Library/Caches/Google/Chrome/Default
/bin/rm -rf /tmp/Google/Chrome
# and let's create a flag for next run that we moved the cache.
echo "";
fi
else
echo "No Google chrome folder has been found. Skiping."
fi
}
15 changes: 15 additions & 0 deletions Contents/MacOS/apps/intellij-14
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

app_name="IntelliJ Idea 14"

move_idea_cache()
{
if [ -d "/Applications/IntelliJ IDEA 14.app" ]; then
close_app "IntelliJ Idea 14"
# make a backup of config - will need it when uninstalling
cp -f /Applications/IntelliJ\ IDEA\ 14.app/Contents/bin/idea.properties /Applications/IntelliJ\ IDEA\ 14.app/Contents/bin/idea.properties.back
# Idea will create those dirs
echo "idea.system.path=${USERRAMDISK}/Idea" >> /Applications/IntelliJ\ IDEA\ 14.app/Contents/bin/idea.properties
echo "idea.log.path=${USERRAMDISK}/Idea/logs" >> /Applications/IntelliJ\ IDEA\ 14.app/Contents/bin/idea.properties
echo "Moved IntelliJ cache."
fi
}
15 changes: 15 additions & 0 deletions Contents/MacOS/apps/intellij-15
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

app_name="IntelliJ Idea 15"

move_idea_cache()
{
if [ -d "/Applications/IntelliJ IDEA 15.app" ]; then
close_app "IntelliJ Idea 15"
# make a backup of config - will need it when uninstalling
cp -f /Applications/IntelliJ\ IDEA\ 15.app/Contents/bin/idea.properties /Applications/IntelliJ\ IDEA\ 15.app/Contents/bin/idea.properties.back
# Idea will create those dirs
echo "idea.system.path=${USERRAMDISK}/Idea" >> /Applications/IntelliJ\ IDEA\ 15.app/Contents/bin/idea.properties
echo "idea.log.path=${USERRAMDISK}/Idea/logs" >> /Applications/IntelliJ\ IDEA\ 15.app/Contents/bin/idea.properties
echo "Moved IntelliJ cache."
fi
}
17 changes: 17 additions & 0 deletions Contents/MacOS/apps/intellij-idea-ce-14
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@


app_name="IntelliJ Idea 14 CE"


move_ideace_cache()
{
if [ -d "/Applications/IntelliJ IDEA 14 CE.app" ]; then
close_app "IntelliJ Idea 14 CE"
# make a backup of config - will need it when uninstalling
cp -f /Applications/IntelliJ\ IDEA\ 14\ CE.app/Contents/bin/idea.properties /Applications/IntelliJ\ IDEA\ 14\ CE.app/Contents/bin/idea.properties.back
# Idea will create those dirs
echo "idea.system.path=${USERRAMDISK}/Idea" >> /Applications/IntelliJ\ IDEA\ 14\ CE.app/Contents/bin/idea.properties
echo "idea.log.path=${USERRAMDISK}/Idea/logs" >> /Applications/IntelliJ\ IDEA\ 14\ CE.app/Contents/bin/idea.properties
echo "Moved IntelliJ cache."
fi
}
13 changes: 13 additions & 0 deletions Contents/MacOS/apps/itunes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

app_name="iTunes"

move_itunes_cache()
{
if [ -d "/Users/${USER}/Library/Caches/com.apple.iTunes" ]; then
close_app "iTunes"
/bin/rm -rf /Users/${USER}/Library/Caches/com.apple.iTunes
/bin/mkdir -pv ${USERRAMDISK}/Apple/iTunes
/bin/ln -v -s ${USERRAMDISK}/Apple/iTunes ~/Library/Caches/com.apple.iTunes
echo "Moved iTunes cache."
fi
}
15 changes: 15 additions & 0 deletions Contents/MacOS/apps/safari
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

app_name="iTunes"

move_safari_cache()
{
if [ -d "/Users/${USER}/Library/Caches/com.apple.Safari" ]; then
if user_response "Do you want to move Safari cache?"; then
close_app "Safari"
/bin/rm -rf ~/Library/Caches/com.apple.Safari
/bin/mkdir -p ${USERRAMDISK}/Apple/Safari
/bin/ln -s ${USERRAMDISK}/Apple/Safari ~/Library/Caches/com.apple.Safari
echo "Moved Safari cache."
fi
fi
}
13 changes: 13 additions & 0 deletions Contents/MacOS/apps/template_app
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash -x

#
# name of the app goes here
#
name_of_function_to_move_app_cache()
{
close_app "app name"
echo "moving app name cache";
# do whatever you need to do to move the caches and add cron jobs with rsync etc
echo "Moved app name cache."
fi
}
Loading