Last active
August 14, 2022 06:39
-
-
Save elvisciotti/a70e2b1604a37516ba9edbf21d3a95cf to your computer and use it in GitHub Desktop.
Bash script to create ram disk to be used to speed up IntelliJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ramDiskCreate () | |
{ | |
if [ ! -d /Volumes/RAMDisk/intellij-cache/ ]; then | |
diskutil erasevolume HFS+ 'RAMDisk' `hdiutil attach -nomount ram://1024288`; | |
else | |
echo RAMDisk already created; | |
fi; | |
mkdir -p /Volumes/RAMDisk/intellij-caches; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And symlink with
mv ~/Library/Caches/PhpStorm2018.2/index/* /Volumes/RAMDisk/phpstorm-index/
rm -rf ~/Library/Caches/PhpStorm2018.2/index
ln -s /Volumes/RAMDisk/phpstorm-index/ ~/Library/Caches/PhpStorm2018.2/index
mv ~/Library/Caches/PhpStorm2018.2/caches/* /Volumes/RAMDisk/phpstorm-caches/
rm -rf ~/Library/Caches/PhpStorm2018.2/caches
ln -s /Volumes/RAMDisk/phpstorm-caches/ ~/Library/Caches/PhpStorm2018.2/caches
ls -la ~/Library/Caches/PhpStorm2018.2