orome
orome

Reputation: 48566

Can I run a shell alias or function as a JetBrains IDE "External Tool"?

In my .bash_profile I have

_func () {
   ... ${1} ${2}
}
alias func="_func"

and would like to be able to call func (or _func) in a JetBrains IDE "External Tool" (by specifying either as a "Program"). But when I do so I get

Cannot run program "func"

Is there a way to run a shell alias or function as a JetBrains IDE "External Tool"?


I know there is a plugin with some limited support for something similar, but this does not support the IDE "macro" variables, as "External Tools" do.

Upvotes: 1

Views: 345

Answers (1)

Zombo
Zombo

Reputation: 1

The command you use must have an underlying executable. In this case it would be /bin/bash or similar, but Bash aliases are only available in the scope of a Bash shell.

As better solution would be to write a short Bash script and call that instead.

If you insist on using an alias, this will do it:

bash -l -c func

Upvotes: 1

Related Questions