(customConfigPath?: string)
| 176 | } |
| 177 | |
| 178 | function findRcFile(customConfigPath?: string): string | undefined { |
| 179 | // If --config specified, use that exclusively |
| 180 | if (customConfigPath) { |
| 181 | if (existsSync(customConfigPath)) return customConfigPath; |
| 182 | throw new Error(`Config file not found: ${customConfigPath}`); |
| 183 | } |
| 184 | |
| 185 | // Check current directory |
| 186 | for (const filename of ['.svelteesp32rc.json', '.svelteesp32rc']) { |
| 187 | const cwdPath = path.join(process.cwd(), filename); |
| 188 | if (existsSync(cwdPath)) return cwdPath; |
| 189 | } |
| 190 | |
| 191 | // Check home directory |
| 192 | const homeDirectory = homedir(); |
| 193 | for (const filename of ['.svelteesp32rc.json', '.svelteesp32rc']) { |
| 194 | const homePath = path.join(homeDirectory, filename); |
| 195 | if (existsSync(homePath)) return homePath; |
| 196 | } |
| 197 | |
| 198 | return undefined; |
| 199 | } |
| 200 | |
| 201 | function findPackageJson(rcFilePath: string): string | undefined { |
| 202 | const rcDirectory = path.dirname(rcFilePath); |
no outgoing calls
no test coverage detected