Shell Script Configuration

Answered

I recently switched to IntelliJ from Eclipse and need to port my 3 script configurations.  In Eclipse, I had multiple "projects" within a single "workspace," whereas in IntelliJ I have multiple "modules" within a single "project."  All set, no problem.

In Eclipse, I could run my 3 script configurations against each project, with context determined by selecting the project header.  With that context, Eclipse provided some variables that I could reference when calling the script, namely ${project_name}, ${git_branch}, and ${project_loc}.  So all I had to do was select the project and run whichever script I needed.

I'm trying to determine how to port that workflow to IntelliJ.  My 3 questions are:

  1. Are there similar variables that are determined by context (which "module" is selected)?
  2. Can I do something like the below configuration to invoke my scripts?
  3. Can I put an asterisk (*) within a path to match any directory name as I've done in the configuration below?

Thanks in advance for any assistance.

0
1 comment

There is no way to access Git Branch name from the run configuration or external tools: https://youtrack.jetbrains.com/issue/IDEA-141253 .

More variables are available for External Tools than for Run Configurations, see https://www.jetbrains.com/help/idea/settings-tools-external-tools.html .

Script path is the absolute path and no asterisks are expanded/evaluated there.

You can create a more generic .sh script that will iterate and run other scripts in different directories and also obtain git branch by running `git` command in the specified directory and extracting the branch name from the output.

0

Please sign in to leave a comment.