Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read env from Fastfile #76

Open
detatsatrio opened this issue May 15, 2024 · 2 comments
Open

Read env from Fastfile #76

detatsatrio opened this issue May 15, 2024 · 2 comments

Comments

@detatsatrio
Copy link

Hi Guys, is possible to read env from keys to fastfile for fastlane feature?

I've try with ENV["APPCENTER_KEY"] is not working yet, same way with react-native-config.

Thanks in advance

Copy link

👋 @detatsatrio
Thanks for opening your issue here! If you find this package useful hit the star🌟!

@ngocle2497
Copy link
Contributor

ngocle2497 commented Jul 18, 2024

Hi Guys, is possible to read env from keys to fastfile for fastlane feature?

I've try with ENV["APPCENTER_KEY"] is not working yet, same way with react-native-config.

Thanks in advance

U can use this function to load env:

lane :load_env_from_json do |params|
  # Load environment variables from the JSON file
  json_data = JSON.parse(File.read(params[:file]))

  # Set the environment variables
  json_data.each do |key, value|
    json_data.each do |scope, values|
      values.each do |key, value|
        ENV["#{key}"] = value
      end
    end
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants