I've had similar problem and I've not found solution for stream detecting.
I recommend you two workaround:
- Add flag variable to load script, then with IF statement diferentiate the blocks. You always have to manipulate the script.
- Create an application that save data, and create a task with event trigger for it attached to the original application. You can enable/disable this task based on prod/test purpose.
I think I may have a work-around. I found a function in the help that returns the app name. I have set up my Dev apps to be called Dev. So for instance I have an app called 'QVD Generator Dev'. When I want it to go live, I use the QMC to publish it. In the publish options I choose overwrite and select the app called 'QVD Generator'. Then after the publish the published app is still called 'QVD Generator', but has the new stuff in it, and I still have my Dev app.
So my thinking is to use this function to determine if the app ends in Dev. If it does then use the test QVD folder, otherwise use the live QVD folder.
I haven't tried it yet! I'll get back with another post after trying it.