(baseFilename)
| 76 | * @returns |
| 77 | */ |
| 78 | const getRcGlobalPath = async (baseFilename) => { |
| 79 | const homeConfigGlobalConfigPath = getRcDefaultConfigPath(baseFilename) |
| 80 | const defaultGlobalConfigPath = getRcDefaultPath(baseFilename) |
| 81 | const homeConfigGlobalConfigExists = await fileExists( |
| 82 | homeConfigGlobalConfigPath, |
| 83 | ) |
| 84 | const defaultGlobalConfigExists = await fileExists(defaultGlobalConfigPath) |
| 85 | |
| 86 | if (homeConfigGlobalConfigExists && defaultGlobalConfigExists) { |
| 87 | return defaultGlobalConfigPath |
| 88 | } |
| 89 | |
| 90 | if (homeConfigGlobalConfigExists) { |
| 91 | return homeConfigGlobalConfigPath |
| 92 | } |
| 93 | |
| 94 | return defaultGlobalConfigPath |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * Gets the .{baseFilename}rc configuration file in the current working directory, if it exists. |
no test coverage detected