I have made an extension to the "server-build.js" grunt task that runs a task of my own at the end of the script, when you download a course from the Adapt AT.
One of the things this task does is to add a setting to the SPOOR section in "config.js".
This works fine, if I use "Download" to download a course package.
But in one case it does not work, and I am having trouble finding out why...
If I first run a "Preview" and then a "Download" the setting in the "config.js" is gone.
If I look in the "temp" folder on the AT server and check the course's "build/course" folder, the added setting is in the "config.js" file.
If I then run a "Download", the "config.js" in the "build/course" folder is changed, and no longer has the added setting, and of course the new "download.zip" file in the "build" folder does not have it either.
I suspect it is some kind of build optimisation that prevents my script from running (which seems to be what is happening) but I cannot quite figure out how to get around this.