From ac9e461561b2b82a06cda5bbcbb4a26570b0e2fc Mon Sep 17 00:00:00 2001 From: zafarella Date: Fri, 11 Sep 2015 22:06:19 -0400 Subject: [PATCH 1/3] add draft homebrew formula --- homebrew-osx-ramdisk/Formula/osx-ramdisk.rb | 19 +++++++++++++++++++ homebrew-osx-ramdisk/readme.md | 1 + 2 files changed, 20 insertions(+) create mode 100644 homebrew-osx-ramdisk/Formula/osx-ramdisk.rb create mode 100644 homebrew-osx-ramdisk/readme.md diff --git a/homebrew-osx-ramdisk/Formula/osx-ramdisk.rb b/homebrew-osx-ramdisk/Formula/osx-ramdisk.rb new file mode 100644 index 0000000..5f3809c --- /dev/null +++ b/homebrew-osx-ramdisk/Formula/osx-ramdisk.rb @@ -0,0 +1,19 @@ +class ramdisk < Formula + desc "Creates ram-disk making browsers and IDEs fly." + homepage "http://zafarella.github.io/OSX-RAMDisk/" + url "https://github.com/zafarella/OSX-RAMDisk/tarball/master" + sha256 "" + head "https://github.com/zafarella/OSX-RAMDisk.git" + version "1.0" + + depends_on "newfs_hfs" + + def install + system "Contents/MacOS/startupRAMDiskandCacheMover.sh" + end + + test do + system "ls -lsa /Volumes/${USER}" + end + +end diff --git a/homebrew-osx-ramdisk/readme.md b/homebrew-osx-ramdisk/readme.md new file mode 100644 index 0000000..8058070 --- /dev/null +++ b/homebrew-osx-ramdisk/readme.md @@ -0,0 +1 @@ +This is homebrew formula for ram-disk creator From dacab5d4ecfdeba4b34bc58bee4a473c03a299fd Mon Sep 17 00:00:00 2001 From: zafarella Date: Sat, 26 Sep 2015 13:34:06 -0400 Subject: [PATCH 2/3] OSX-RAMDisk-17 split applications by files - initial commit --- Contents/MacOS/apps/android-studio | 18 +++ Contents/MacOS/apps/appcode | 19 +++ Contents/MacOS/apps/chrome-canary | 11 ++ Contents/MacOS/apps/clion | 18 +++ Contents/MacOS/apps/google-chrome | 21 +++ Contents/MacOS/apps/intellij-14 | 12 ++ Contents/MacOS/apps/intellij-idea-ce | 12 ++ Contents/MacOS/apps/itunes | 10 ++ Contents/MacOS/apps/safari | 12 ++ Contents/MacOS/apps/template_app | 13 ++ Contents/MacOS/startupRAMDiskandCacheMover.sh | 130 ++---------------- 11 files changed, 155 insertions(+), 121 deletions(-) create mode 100644 Contents/MacOS/apps/android-studio create mode 100644 Contents/MacOS/apps/appcode create mode 100644 Contents/MacOS/apps/chrome-canary create mode 100644 Contents/MacOS/apps/clion create mode 100644 Contents/MacOS/apps/google-chrome create mode 100644 Contents/MacOS/apps/intellij-14 create mode 100644 Contents/MacOS/apps/intellij-idea-ce create mode 100644 Contents/MacOS/apps/itunes create mode 100644 Contents/MacOS/apps/safari create mode 100644 Contents/MacOS/apps/template_app diff --git a/Contents/MacOS/apps/android-studio b/Contents/MacOS/apps/android-studio new file mode 100644 index 0000000..78a1147 --- /dev/null +++ b/Contents/MacOS/apps/android-studio @@ -0,0 +1,18 @@ +#!/usr/bin/env bash -x + +# +# 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 +} diff --git a/Contents/MacOS/apps/appcode b/Contents/MacOS/apps/appcode new file mode 100644 index 0000000..d844593 --- /dev/null +++ b/Contents/MacOS/apps/appcode @@ -0,0 +1,19 @@ +# +# 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 +} diff --git a/Contents/MacOS/apps/chrome-canary b/Contents/MacOS/apps/chrome-canary new file mode 100644 index 0000000..d3eec5e --- /dev/null +++ b/Contents/MacOS/apps/chrome-canary @@ -0,0 +1,11 @@ +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 +} diff --git a/Contents/MacOS/apps/clion b/Contents/MacOS/apps/clion new file mode 100644 index 0000000..f2d41bb --- /dev/null +++ b/Contents/MacOS/apps/clion @@ -0,0 +1,18 @@ +# +# 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 +} diff --git a/Contents/MacOS/apps/google-chrome b/Contents/MacOS/apps/google-chrome new file mode 100644 index 0000000..d62486a --- /dev/null +++ b/Contents/MacOS/apps/google-chrome @@ -0,0 +1,21 @@ +# +# Google Chrome Cache +# +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 +} diff --git a/Contents/MacOS/apps/intellij-14 b/Contents/MacOS/apps/intellij-14 new file mode 100644 index 0000000..f94018f --- /dev/null +++ b/Contents/MacOS/apps/intellij-14 @@ -0,0 +1,12 @@ +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 +} diff --git a/Contents/MacOS/apps/intellij-idea-ce b/Contents/MacOS/apps/intellij-idea-ce new file mode 100644 index 0000000..b4bdca1 --- /dev/null +++ b/Contents/MacOS/apps/intellij-idea-ce @@ -0,0 +1,12 @@ +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 +} diff --git a/Contents/MacOS/apps/itunes b/Contents/MacOS/apps/itunes new file mode 100644 index 0000000..9a5e964 --- /dev/null +++ b/Contents/MacOS/apps/itunes @@ -0,0 +1,10 @@ +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 +} diff --git a/Contents/MacOS/apps/safari b/Contents/MacOS/apps/safari new file mode 100644 index 0000000..8b38309 --- /dev/null +++ b/Contents/MacOS/apps/safari @@ -0,0 +1,12 @@ +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 +} diff --git a/Contents/MacOS/apps/template_app b/Contents/MacOS/apps/template_app new file mode 100644 index 0000000..d1a1226 --- /dev/null +++ b/Contents/MacOS/apps/template_app @@ -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 +} diff --git a/Contents/MacOS/startupRAMDiskandCacheMover.sh b/Contents/MacOS/startupRAMDiskandCacheMover.sh index cd78f06..8636d6f 100755 --- a/Contents/MacOS/startupRAMDiskandCacheMover.sh +++ b/Contents/MacOS/startupRAMDiskandCacheMover.sh @@ -137,159 +137,47 @@ make_flag() # # Google Chrome Cache # -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 -} +. apps/google-chrome # # Chrome Canary Cache # -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 -} +. apps/chrome-canary # # Safari Cache # -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 -} +. /apps/safari # # iTunes Cache # -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 -} +. /apps/itunes # # Intellij Idea # -# fixme - what if the version is not 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 -} +. /apps/intellij-14 # # Intellij Idea Community Edition # -move_ideace_cache() -{ - # todo add other versions support and CE edition - 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 -} +. /apps/intellij-idea-ce # # 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 -} +. /apps/android-studio # # 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 -} +. /apps/clion # # 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 -} +. /apps/appcode # ----------------------------------------------------------------------------------- From f4f8208ae92de3d8d61a31960378e09e513accf8 Mon Sep 17 00:00:00 2001 From: zafarella Date: Wed, 25 Nov 2015 01:06:20 -0500 Subject: [PATCH 3/3] -- add loop to check for apps --- Contents/MacOS/apps/android-studio | 2 ++ Contents/MacOS/apps/appcode | 3 +++ Contents/MacOS/apps/chrome-canary | 4 ++++ Contents/MacOS/apps/clion | 3 +++ Contents/MacOS/apps/google-chrome | 5 +++++ Contents/MacOS/apps/intellij-14 | 3 +++ Contents/MacOS/apps/intellij-15 | 15 +++++++++++++++ .../{intellij-idea-ce => intellij-idea-ce-14} | 5 +++++ Contents/MacOS/apps/itunes | 3 +++ Contents/MacOS/apps/safari | 3 +++ Contents/MacOS/startupRAMDiskandCacheMover.sh | 16 ++++++++++++---- 11 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 Contents/MacOS/apps/intellij-15 rename Contents/MacOS/apps/{intellij-idea-ce => intellij-idea-ce-14} (95%) diff --git a/Contents/MacOS/apps/android-studio b/Contents/MacOS/apps/android-studio index 78a1147..d5314e3 100644 --- a/Contents/MacOS/apps/android-studio +++ b/Contents/MacOS/apps/android-studio @@ -3,6 +3,8 @@ # # Android Studio # +app_name="Android Studio" + move_android_studio_cache() { close_app "Android Studio" diff --git a/Contents/MacOS/apps/appcode b/Contents/MacOS/apps/appcode index d844593..a6b6d62 100644 --- a/Contents/MacOS/apps/appcode +++ b/Contents/MacOS/apps/appcode @@ -1,6 +1,9 @@ # # AppCode # + +app_name="AppCode" + move_appcode_cache() { if [ -d "/Applications/AppCode.app" ]; then diff --git a/Contents/MacOS/apps/chrome-canary b/Contents/MacOS/apps/chrome-canary index d3eec5e..ad322ef 100644 --- a/Contents/MacOS/apps/chrome-canary +++ b/Contents/MacOS/apps/chrome-canary @@ -1,3 +1,7 @@ + + +app_name="Chrome Canary" + move_chrome_chanary_cache() { if [ -d "/Users/${USER}/Library/Caches/Google/Chrome Canary" ]; then diff --git a/Contents/MacOS/apps/clion b/Contents/MacOS/apps/clion index f2d41bb..a02996b 100644 --- a/Contents/MacOS/apps/clion +++ b/Contents/MacOS/apps/clion @@ -1,6 +1,9 @@ # # Clion # + +app_name="Clion" + move_clion_cache() { if [ -d "/Applications/Clion.app" ]; then diff --git a/Contents/MacOS/apps/google-chrome b/Contents/MacOS/apps/google-chrome index d62486a..5881fbc 100644 --- a/Contents/MacOS/apps/google-chrome +++ b/Contents/MacOS/apps/google-chrome @@ -1,6 +1,11 @@ +#!/usr/bin/env bash + # # Google Chrome Cache # + +app_name="Google Chrome" + move_chrome_cache() { if [ -d "/Users/${USER}/Library/Caches/Google/Chrome" ]; then diff --git a/Contents/MacOS/apps/intellij-14 b/Contents/MacOS/apps/intellij-14 index f94018f..0bd6891 100644 --- a/Contents/MacOS/apps/intellij-14 +++ b/Contents/MacOS/apps/intellij-14 @@ -1,3 +1,6 @@ + +app_name="IntelliJ Idea 14" + move_idea_cache() { if [ -d "/Applications/IntelliJ IDEA 14.app" ]; then diff --git a/Contents/MacOS/apps/intellij-15 b/Contents/MacOS/apps/intellij-15 new file mode 100644 index 0000000..d50ad21 --- /dev/null +++ b/Contents/MacOS/apps/intellij-15 @@ -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 +} diff --git a/Contents/MacOS/apps/intellij-idea-ce b/Contents/MacOS/apps/intellij-idea-ce-14 similarity index 95% rename from Contents/MacOS/apps/intellij-idea-ce rename to Contents/MacOS/apps/intellij-idea-ce-14 index b4bdca1..605ad9a 100644 --- a/Contents/MacOS/apps/intellij-idea-ce +++ b/Contents/MacOS/apps/intellij-idea-ce-14 @@ -1,3 +1,8 @@ + + +app_name="IntelliJ Idea 14 CE" + + move_ideace_cache() { if [ -d "/Applications/IntelliJ IDEA 14 CE.app" ]; then diff --git a/Contents/MacOS/apps/itunes b/Contents/MacOS/apps/itunes index 9a5e964..61f0269 100644 --- a/Contents/MacOS/apps/itunes +++ b/Contents/MacOS/apps/itunes @@ -1,3 +1,6 @@ + +app_name="iTunes" + move_itunes_cache() { if [ -d "/Users/${USER}/Library/Caches/com.apple.iTunes" ]; then diff --git a/Contents/MacOS/apps/safari b/Contents/MacOS/apps/safari index 8b38309..7060c44 100644 --- a/Contents/MacOS/apps/safari +++ b/Contents/MacOS/apps/safari @@ -1,3 +1,6 @@ + +app_name="iTunes" + move_safari_cache() { if [ -d "/Users/${USER}/Library/Caches/com.apple.Safari" ]; then diff --git a/Contents/MacOS/startupRAMDiskandCacheMover.sh b/Contents/MacOS/startupRAMDiskandCacheMover.sh index e27499f..6816fc4 100755 --- a/Contents/MacOS/startupRAMDiskandCacheMover.sh +++ b/Contents/MacOS/startupRAMDiskandCacheMover.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash -x +#!/usr/bin/env bash -xa # Copyright Zafar Khaydarov # @@ -24,7 +24,7 @@ mount_point=/Volumes/ramdisk ramfs_size_sectors=$((${ramfs_size_mb}*1024*1024/512)) ramdisk_device=`hdid -nomount ram://${ramfs_size_sectors}` USERRAMDISK="$mount_point/${USER}" - +script_folder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # # Checks for the user response. # @@ -128,7 +128,7 @@ check_for_flag() # make_flag() { - echo "" > /Applications/OSX-RAMDisk.app/${1} + echo "" > ${script_folder}/settings/${1} } # ------------------------------------------------------ @@ -136,6 +136,14 @@ make_flag() # Add yours at the end. # ------------------------------------------------------- +apps=./apps/* +for f in ${apps}; do + source ${f} # todo get the file name only + if user_response "I found ${app_name}, would you keep it's cache in RAM?" ; then + make_flag ${f} + fi +done + # # Google Chrome Cache # @@ -164,7 +172,7 @@ make_flag() # # Intellij Idea Community Edition # -. /apps/intellij-idea-ce +. apps/intellij-idea-ce-14 # # Android Studio