Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

People also ask

How do I debug a script in IntelliJ?

Start debuggingOpen the HTML file that references the JavaScript to debug or select the HTML file in the Project tool window. From the context menu of the editor or the selection, choose Debug <HTML_file_name>. IntelliJ IDEA generates a debug configuration and starts a debugging session through it.

How do I get to the run debug configuration in IntelliJ?

From the main menu, select Run | Edit Configurations. Alternatively, press Alt+Shift+F10 , then 0 . on the toolbar or press Alt+Insert . The list shows the run/debug configuration templates.


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


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

Screenshot

edit tool add shell script


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


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.