Skip to content

Commit

Permalink
Allow exported env file
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangSenff authored Mar 19, 2024
1 parent 2e2c302 commit 226bdd5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addons/godot-firebase/firebase/firebase.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const _ENVIRONMENT_VARIABLES : String = "firebase/environment_variables"
const _EMULATORS_PORTS : String = "firebase/emulators/ports"
const _AUTH_PROVIDERS : String = "firebase/auth_providers"

@export_global_file("*.env") var EnvPath : String

## @type FirebaseAuth
## The Firebase Authentication API.
@onready var Auth : FirebaseAuth = $Auth
Expand Down Expand Up @@ -99,7 +101,7 @@ func _check_emulating() -> void:
func _load_config() -> void:
if not (_config.apiKey != "" and _config.authDomain != ""):
var env = ConfigFile.new()
var err = env.load("res://addons/godot-firebase/.env")
var err = env.load("res://addons/godot-firebase/.env" if EnvPath == null else EnvPath)
if err == OK:
for key in _config.keys():
var config_value = _config[key]
Expand Down

0 comments on commit 226bdd5

Please sign in to comment.