MCPcopy Index your code
hub / github.com/coder/mux / hasLocalGitmodules

Function hasLocalGitmodules

src/node/runtime/submoduleSync.ts:109–125  ·  view source on GitHub ↗
(workspacePath: string)

Source from the content-addressed store, hash-verified

107}
108
109async function hasLocalGitmodules(workspacePath: string): Promise<boolean> {
110 const gitmodulesPath = path.join(workspacePath, ".gitmodules");
111
112 try {
113 const stat = await fs.stat(gitmodulesPath);
114 if (stat.isDirectory()) {
115 throw new Error(`${gitmodulesPath} is a directory`);
116 }
117 return true;
118 } catch (error) {
119 if (hasErrorCode(error, "ENOENT")) {
120 return false;
121 }
122
123 throw formatGitmodulesProbeError(error);
124 }
125}
126
127async function hasRuntimeGitmodules(args: RuntimeSubmoduleSyncArgs): Promise<boolean> {
128 const env = buildGitExecutionEnv({ env: args.env, trusted: args.trusted });

Callers 1

syncLocalGitSubmodulesFunction · 0.85

Calls 3

hasErrorCodeFunction · 0.90
statMethod · 0.65

Tested by

no test coverage detected