In brief Opening a PyCharm project takes long time due to index/cache build process - to speed it up, I'm looking for how to call PyCharm to build that via a command line.
This question is also posted as PyCharm ticket here
In details PyCharm index build takes long time to finish which is quite annoying when start working with project.
I want that run to be executed via command line so that I can run them at night e.g. 03:00 AM. That will help us to open the project quickly since the cache/index has been prepared by our scheduled command-line above.
So the question is, what is the command to do so? My google search on this topic and on our site is empty so I asked here.
p.s.
We can open a PyCharm project via command line as discussed here; though I cannot find an option for building index/cache.
$ charm --help
Usage:
/usr/local/bin/charm -h | -? | --help
/usr/local/bin/charm [project_dir]
/usr/local/bin/charm [-l|--line line] [project_dir|--temp-project] file[:line]
/usr/local/bin/charm diff <left> <right>
/usr/local/bin/charm merge <local> <remote> [base] <merged>
This is the workaround for now on my Ubuntu Desktop 16.04
Please make sure charm
command is installed on your system to call reload_pycharm_projects
bash command as defined below.
function reload_pycharm_projects() {
cd $path_to_code_home
echo 'Running PyCharm...'
charm &
sleep 16 # wait 16s for PyCharm window to be opened; put in the time suitable on your machine
# open pycharm projects - list all projects of your interest below
echo 'Loading projects...'
charm p1
charm p2
charm p3
sleep 90 # wait 90s for all project load & index/cache refreshed; put in more time as you want
cd --
echo 'Closing Pycharm...'
kill -9 $(ps x | grep -E .+java.+PyCharm | awk '{print $1}') # kill pycharm window
exit
}