MCPcopy
hub / github.com/electron/forge / resolveWorkingDir

Function resolveWorkingDir

packages/api/cli/src/util/resolve-working-dir.ts:11–25  ·  view source on GitHub ↗
(dir: string, checkExisting = true)

Source from the content-addressed store, hash-verified

9 * @returns
10 */
11export function resolveWorkingDir(dir: string, checkExisting = true): string {
12 if (!dir) {
13 return process.cwd();
14 }
15
16 const resolved = path.isAbsolute(dir)
17 ? dir
18 : path.resolve(process.cwd(), dir);
19
20 if (checkExisting && !fs.existsSync(resolved)) {
21 return process.cwd();
22 } else {
23 return resolved;
24 }
25}

Calls

no outgoing calls

Tested by

no test coverage detected