I'm handling the env config in my React Native project by copying either config.template_prod.js or config.template_preprod.js into config.js. This is a high risk operation since shipping preprod instead of prod to a client can make all users unable to login for up to 3 days (before rebuild and app store review approval).
Right now im using build schemes to choose which config I want to copy but this is a bad solution - one can forget and also it changes the .xcscheme file which is watched by git.
A perfect solution for me would be to be able to pause the build from withing the build script and perhaps trigger a node js program which opens a system window and has the user choose Preprod vs Prod. This would leave little room for mistakes. Is that in any way possible? I'm open to blackmagic hacky solutions - I'm really desparate here.
config.template_prod.js