Finding plugins directory in a bash script

I'm using PyCharm and I need to execute a plugin jar from a bash script.

The docs say the plugins can be found in Linux at

~/.local/share/JetBrains/<product><version>

Or, when the IDE was installed using the Toolbox App, they can be found using the menu Help | Edit Custom VM Options, which opens a file like 231.9011.38.vmoptions containing a line like

-Didea.plugins.path=/home/xxx/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/231.9011.38.plugins

That's ok when done manually.

The problem when trying to find 231.9011.38.vmoptions without the IDE is that it's located exactly in the same place you are trying to find:

/home/xxx/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/231.9011.38.vmoptions

A search for .plugins directories under ~/.local/share/JetBrains finds

/home/xxx/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/231.9011.38.plugins
/home/xxx/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/231.8770.66.plugins
/home/xxx/.local/share/JetBrains/Toolbox/apps/CLion/ch-0/231.9011.31.plugins

So the Toolbox App maintains two versions for some reason. Selecting the most recent solves the problem.

But i guess there must be a more straightforward way to find the plugins directory from a bash script.

0

请先登录再写评论。