(rootDir: string)
| 149 | } |
| 150 | |
| 151 | async function loadExtConfig(rootDir: string): Promise<ExtConfigPairs> { |
| 152 | const extConfigFilePathTS = resolve(rootDir, CONFIG_FILE_NAME_TS); |
| 153 | |
| 154 | if (await pathExists(extConfigFilePathTS)) { |
| 155 | return loadExtConfigTS(rootDir, CONFIG_FILE_NAME_TS, extConfigFilePathTS); |
| 156 | } |
| 157 | |
| 158 | const extConfigFilePathJS = resolve(rootDir, CONFIG_FILE_NAME_JS); |
| 159 | |
| 160 | if (await pathExists(extConfigFilePathJS)) { |
| 161 | return loadExtConfigJS(rootDir, CONFIG_FILE_NAME_JS, extConfigFilePathJS); |
| 162 | } |
| 163 | |
| 164 | const extConfigFilePath = resolve(rootDir, CONFIG_FILE_NAME_JSON); |
| 165 | |
| 166 | return { |
| 167 | extConfigType: 'json', |
| 168 | extConfigName: CONFIG_FILE_NAME_JSON, |
| 169 | extConfigFilePath: extConfigFilePath, |
| 170 | extConfig: (await tryFn(readJSON, extConfigFilePath)) ?? {}, |
| 171 | }; |
| 172 | } |
| 173 | |
| 174 | async function loadCLIConfig(rootDir: string): Promise<CLIConfig> { |
| 175 | const assetsDir = 'assets'; |
no test coverage detected