File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -112,8 +112,13 @@ private function registerConfig(): void
112
112
{
113
113
$ this ->mergeConfigFrom (self ::CONFIG_PATH , self ::CONFIG_KEY );
114
114
115
- $ googleCredentials = (string )config (self ::CONFIG_KEY .'.google_application_credentials ' );
115
+ // Check if it should set GOOGLE_APPLICATION_CREDENTIALS to the configured path
116
+ $ currentGoogleCredPath = getenv ('GOOGLE_APPLICATION_CREDENTIALS ' );
117
+ if ($ currentGoogleCredPath && file_exists ($ currentGoogleCredPath )) {
118
+ return ;
119
+ }
116
120
121
+ $ googleCredentials = (string )config (self ::CONFIG_KEY .'.google_application_credentials ' );
117
122
if (! empty ($ googleCredentials ) && ! is_dir ($ googleCredentials )) {
118
123
if (! file_exists ($ googleCredentials )) {
119
124
throw new RuntimeException ("Google Application Credentials file not found at $ googleCredentials " );
You can’t perform that action at this time.
0 commit comments