I'm running 1.8.7 on a Linux box. I'm trying to use the recipe.hooks.sketch.prebuild.x.pattern to invoke a bash script pre-compile. I want to pass the sketch's pathname in to my bash script. Here's my recipe:
recipe.hooks.sketch.prebuild.1.pattern=/home/user/bin/myCmd "{source_file}"
(My bash script uses dirname to get the sketch's home folder and then writes a custom header file there with a unique serial number.)
myCmd runs fine but "{source_file}" is not interpreted, it is passed in verbatim, which of course makes no sense to my script.
To verify where the problem lies, I changed "{source_file}" to "{build.path}" - that worked! But of course, it's not the directory path I need.
The problem seems to be that "{source_file}" is not yet interpreted when the prebuild pattern is parsed. "{source_file}" is interpreted in subsequent lines in platform.txt.
I've tried moving my recipe line to different locations in platform.txt, putting it after other lines have interpreted "{source_file}", to no avail.
Anyone know how to get the IDE to interpret "{source_file}" in the prebuild recipe??