This is not 100% JUCE related, but maybe someone can help me out here. I need to run a little shell script from my JUCE app which tells the Introjucer to resave a project and xcodebuild to compile it.
This is basically the content:
project="Demo Project" cd "`dirname "$0"`" "/Applications/The Introjucer.app/Contents/MacOS/Introjucer" --resave AutogeneratedProject.jucer echo Compiling VST / AU Plugin $project ... xcodebuild -project "Builds/MacOSX/Demo Project.xcodeproj" -configuration "Release" echo Compiling finished. Cleaning up...
In my app, I create a file (using File.replaceWithText()) and this line to run the code:
String command = "open \"" + batchFile.getFullPathName() + "\""; int returnType = system(command.getCharPointer());
The batch file is written to the same directory as the .jucer file (so that I can use relative paths).
However, the script does not work (even not when executing it by double click), but yields this error message:
christophhart$ /Volumes/Shared/Development/HISE\ modules/extras/demo_project/Binaries/batchCompileOSX ; exit; /Volumes/Shared/Development/HISE modules/extras/demo_project/Binaries/batchCompi: command not found /Volumes/Shared/Development/HISE modules/extras/demo_project/Binaries/batchCompileOSX: line 3: cd: /Volumes/Shared/Development/HISE modules/extras/demo_project/: No such file or directory Could not find file: /Users/christophhart/AutogeneratedProject.jucer /Volumes/Shared/Development/HISE modules/extras/demo_project/Binaries/batchCompi: command not found
It seems like it cuts the lines of the script (and even the start command from 'batchCompileOSX' to 'batchCompi'.
But now comes the weird part: If I create a new text file (in Sublime Text 3), paste the content of the JUCE generated shell script and run this file, everything works and makes me want to scream "Go home OSX, you're drunk".
I checked file permissions (also executable permissions) as well as encoding (UTF-8) and line endings (I tried both "\n" and "\r\n").
Even if I reduce the content (of the JUCE generated script file) to the minimum:
"/Applications/The Introjucer.app/Contents/MacOS/Introjucer"
still no luck. I am on OSX 10.11.2 if that could make any difference.