Search code examples
phpstorm

Is there a way to add bash commands to PhpStorm?


I'm really enjoying some of the new multi-repo tools in PhpStorm. It's made my composer setup much simpler. (no more paths in dev)

However, now that I can git any of my composer packages from any project - it would help to have some better shortcut commands and combination commands in the PhpStorm menu system.

Is there a way in Storm to macro together a few git commands, and add that to the menu system?


Solution

  • @LazyOne provided a great lead - "External Tools". Thanks. Here is a more up-to-date documentation https://www.jetbrains.com/help/phpstorm/settings-tools-external-tools.html

    Based on external tools, my solution was:

    1. Create a bash script in my home directory (not in the project).
    2. (OSX) PhpStorm > Preferences >> Tools > External Tools
    3. click [+]
    4. Program: /Users/YOUR-USER/PhpStorm/GitStuff.sh
    5. Working Dir: $ProjectFileDir$

    $ProjectFileDir$ will be inserted by storm if you leave that field blank.

    Remember to chmod +x /Users/YOUR-USER/PhpStorm/GitStuff.sh