I'm using this command
sed -i'' -e "s/MARKETING_VERSION = 0.0.0;/MARKETING_VERSION = ${version//v};/" -f ios/App/App.xcodeproj/project.pbxproj
to replace the text in that file. This works on Ubuntu, but on Mac it changes the file and also creates a new file in the same directory called "project.bxproj-e" which seems to be the original file.
This command works on Mac:
sed -i '' "s/MARKETING_VERSION = 0.0.0;/MARKETING_VERSION = ${version//v};/" -f ios/App/App.xcodeproj/project.pbxproj
For it to work, I had to add a space after -i and remove the -e, however on Ubuntu I get this error:
sed: can't read s/MARKETING_VERSION = 3.0.0;/MARKETING_VERSION = 0.0.0;/: No such file or directory
I'm just looking for something that works on both envs.
If it helps, sed --version gets me "sed (GNU sed) 4.4" on Ubuntu. On Mac sed --version throws an error, but I can get this from the man page: "The sed utility is expected to be a superset of the IEEE Std 1003.2 (``POSIX.2'') specification." and also mentions that "-E -I -a and -i are non-standard and may not be available on other operating systems". But I don't know how to do it without them.