IntelliJ IDEA: Running a shell script as a Run/Debug Configuration

Intellij Idea

Intellij Idea Problem Overview


Is there a way by which a shell script can be invoked from IntelliJ Run/Debug configurations?

Intellij Idea Solutions


Solution 1 - Intellij Idea

I just found out that we can invoke a shell script with the help of BashSupport plugin.

Solution 2 - Intellij Idea

'Add External tool' in the 'Before Launch' does the trick.

Screenshot

edit tool add shell script

Solution 3 - Intellij Idea

IntelliJ IDEA 2019.2 update

New version of IntelliJ IDEA has Shell Script Support included. It means you can now create Shell Script build for your project.

Edit Configurations > (+) Add New Configuration > Shell Script

You can also build your project before executing your script by adding Run Another Configuration task. That's how it looks like: Add Shell Build window

Solution 4 - Intellij Idea

Not sure about 11, but in 12 there's a part of Run/Debug Configuration that is called "Before Launch" and you can select your shell script in "Add External tool" option.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSundar AnnamalaiView Question on Stackoverflow
Solution 1 - Intellij IdeaSundar AnnamalaiView Answer on Stackoverflow
Solution 2 - Intellij IdeaSiddharthaView Answer on Stackoverflow
Solution 3 - Intellij IdeaKyrietView Answer on Stackoverflow
Solution 4 - Intellij IdeaVicView Answer on Stackoverflow