0

I have a Run Script for Fabric/Crashlytics and before I open source my app, I want to put the key/secret in a file like .env and reference it in the Run Script so that I can git ignore .env and not commit.

How can I achieve this? Thanks

Zack Shapiro
  • 6,648
  • 17
  • 83
  • 151
  • You don't need a Run Script for this; you can inject environment variables in the scheme editor. You retrieve them via NSProcessInfo (now called ProcessInfo in Swift) as I explain here: https://stackoverflow.com/a/24344459/341994 Distinguish the environment for _building_ from the environment for _running_. – matt Jan 25 '18 at 20:10
  • I have a Run Script for Fabric/Crashlytics that has a key and secret and I wanted to move them somewhere where I can gitignore them, commit the codebase and not have the general public see my key/secret – Zack Shapiro Jan 25 '18 at 20:11
  • Then this is an x-y question. Ask about your real problem; don't assume some solution and ask about that. However, your scheme is not part of the commit so it seems to me that my previous comment answers this. – matt Jan 25 '18 at 20:11
  • I'll edit. Sorry. Edit: Edited – Zack Shapiro Jan 25 '18 at 20:12

0 Answers0