I'm trying to run a program defined in an alias (and the alias is defined in a source file)
alias myapp="/somepath/app -arg1 -arg2"
Then I go to IDEA and create an External Tool
Program: Bash
Arguments: -c "source /filewithalias.sh && myapp"
Then when I run, I get the following message:
bash: myapp: command not found
EDIT:
I already tried prepending
shopt -s expand_aliases
To the command string but the result is still the same
Best Answer
The reason of your failure is that
myapp
is evaluated bybash
at the time of the line evaluation, i.e. before its definition. I suggest you to avoid aliases for this purpose (I can't find any easy method with aliases).Here is a simple method. If you don't have already one, create a personnal directory for all your binaries and shell scripts:
Add this new directory within your shell standard
PATH
:Create a new shell script to fire your application with all the required arguments:
check that it is working from your actual environment:
Then call it from IDEA:
check that it is working from within IDEA.