File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed
Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -221,17 +221,22 @@ private static function normalizeProfileNames(array $profiles): array
221221 */
222222 private static function getDefaultConfigPath (array $ env ): ?string
223223 {
224- $ home = $ env ['HOME ' ] ?? $ env ['USERPROFILE ' ] ?? null ;
225- if ($ home === null ) {
226- return null ;
224+ // Check APPDATA for Windows first
225+ $ configDir = $ env ['APPDATA ' ] ?? null ;
226+
227+ if ($ configDir === null ) {
228+ $ home = $ env ['HOME ' ] ?? $ env ['USERPROFILE ' ] ?? null ;
229+ if ($ home === null ) {
230+ return null ;
231+ }
232+
233+ $ configDir = match (\PHP_OS_FAMILY ) {
234+ 'Windows ' => $ home . '\\AppData \\Roaming ' ,
235+ 'Darwin ' => $ home . '/Library/Application Support ' ,
236+ default => $ env ['XDG_CONFIG_HOME ' ] ?? ($ home . '/.config ' ),
237+ };
227238 }
228239
229- $ configDir = match (\PHP_OS_FAMILY ) {
230- 'Windows ' => $ env ['APPDATA ' ] ?? ($ home . '\\AppData \\Roaming ' ),
231- 'Darwin ' => $ home . '/Library/Application Support ' ,
232- default => $ env ['XDG_CONFIG_HOME ' ] ?? ($ home . '/.config ' ),
233- };
234-
235240 return $ configDir . \DIRECTORY_SEPARATOR . 'temporalio ' . \DIRECTORY_SEPARATOR . 'temporal.toml ' ;
236241 }
237242}
You can’t perform that action at this time.
0 commit comments