I already check if the folder exists, but recently ran into the problem where vs2013 tried to export headers to an include directory that didn't exist, so it made an include.file and either overwrote or appended the headers to that file.
if not exist "%MY_DIR%\%2\include" (
echo making include directory for %2
mkdir "%DEV_DIR%\%2\include"
)
That check failed because it found that "%MY_DIR%\%2\include" existed, and never created the directory. So anything that wanted to use the exported header just cried a little.
Usually the script gets run before build but for whatever reason it didn't this time, so I'd like to change the condition on which it makes a directory but googling has been thus far unsuccessful.