Recently I’ve encountered a problem. I have an app that talks to the server. I want it to talk to different servers depending on what branch I’m on right now. I think the way for doing that is create a bash script which creates a .h file like
#define BRANCH @"{here goes branch name}"
The only thing is that I don’t know Bash. At all 🙁
Here is what I’ve tried
branch= git branch| grep '*'
echo $branch
Dunno what to do next… (By the way I’m using Xcode and running this in a “Runs script phase”)
This creates the file for the current branch:
file.h would contain:
#define BRANCH @"your current branch"