Execute git in Post-Export Shell Command

I’m trying to execute git command in the post export shell command of Projucer (Mac).

'git -C %%1%% apply %%1%%/Patch/foo.patch'

Projucer fails export saying that the command exited with code 127 or 128. I’ve tried to run the exact same command in terminal and it executes without any issues. How can i apply a git patch to the project after export?

My actual problem is that i’ve customized a few Juce modules and Projucer overwrites my changes during export and i need to apply the patch everytime. I’d be happy to learn of any other ways to accomplish this.

I believe error code 127 is ‘command not found’. might be a path issue.

I’ve also tried with full path /usr/bin/git. No dice.

What exactly is your patch doing? I would be happy to help you find an alternative way once I know what you are trying to achieve.

The patch itself adds a parameter to the drawPopupMenuBackground method declaration of the look and feel system.

-    void drawPopupMenuBackground (Graphics&, int width, int height) override;
+    void drawPopupMenuBackground(Graphics& g, int width, int height, const Component& popup) override;

and correspondingly some

-    getLookAndFeel().drawPopupMenuBackground (g, getWidth(), getHeight());
+    getLookAndFeel().drawPopupMenuBackground (g, getWidth(), getHeight(), *this);

This change needs to be applied to 9 source files. It’s not complicated and a simple diff patch has been able to take care of this little detail. Applying the patch in a post export command would streamline the workflow for this part.

I use the component to find out the location of the popup and use that information when rendering the background. Actually, i’ve never understood why Juce doesn’t deliver this parameter, but haven’t had the time and energy to ask and request, as i’ve been quite happy with my solution and no one else seems to need it.