MCPcopy Create free account
hub / github.com/BCsabaEngine/svelteesp32 / findRcFile

Function findRcFile

src/commandLine.ts:178–199  ·  view source on GitHub ↗
(customConfigPath?: string)

Source from the content-addressed store, hash-verified

176}
177
178function 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
201function findPackageJson(rcFilePath: string): string | undefined {
202 const rcDirectory = path.dirname(rcFilePath);

Callers 2

loadRcFileConfigFunction · 0.85
parseArgumentsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected