@mjokipii I was able to solve my issue finally, perhaps what I learned will be of use to you. The first thing I noticed is that any time I tried to pass arguments to the command I was calling (whether inside quotes or not) I would get an early exit error. So I don’t think the export shell commands are designed to deal with passing arguments. This was true for both trying to call a command directly, or passing arguments into a shell script which called the command. Like you I was trying to pass JUCE’s path substitution string
%%1%% into the command I was calling as an argument.
Step one was wrapping everything into a shell script instead of trying to call it directly from the Projucer property. So in your case you would create something like
git -C %%1%% apply %%1%%/Patch/foo.patch
Now, of course the path replacement of %%1%% will only work in the Projucer property and not in the shell script, so we need a way to identify our locations. I chose to do this relative to where the shell script exists. For ease of explanation let’s say we just put the
apply-patch.sh script in the root of the project where the
.jucer file is.
In the Projucer’s export shell command:
And inside of the shell script something like this:
git -C $SCRIPT_DIR apply $SCRIPT_DIR/Patch/foo.patch
Since I was calling the nodejs binary that also failed unless I provided an absolute path like
/usr/local/bin/node because it seems like env variables like $PATH are not getting exported when the Projucer invokes the export command; you might have to do the same with git, I’m not sure.
Putting aliases to the absolute paths for things like
git in a .
.bashrc file might get loaded and work with Projucer’s export commands, but I didn’t test it to found out, and since I had to hardcode a path to the binary I’m calling, I just decided to stick it directly in the shell script called by the Projucer.
I hope this helps.