MCPcopy Index your code
hub / github.com/Noumena-Network/code / regenerateCompletionCache

Function regenerateCompletionCache

src/utils/completionCache.ts:146–172  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144 * Called after `ncode update` so completions stay in sync with the new binary.
145 */
146export async function regenerateCompletionCache(): Promise<void> {
147 const shell = detectShell()
148 if (!shell) {
149 return
150 }
151
152 logForDebugging(`update: Regenerating ${shell.name} completion cache`)
153
154 const ncodeBin = process.argv[1] || 'ncode'
155 const result = await execFileNoThrow(ncodeBin, [
156 'completion',
157 shell.shellFlag,
158 '--output',
159 shell.cacheFile,
160 ])
161
162 if (result.code !== 0) {
163 logForDebugging(
164 `update: Failed to regenerate ${shell.name} completion cache`,
165 )
166 return
167 }
168
169 logForDebugging(
170 `update: Regenerated ${shell.name} completion cache at ${shell.cacheFile}`,
171 )
172}

Callers 1

updateFunction · 0.85

Calls 3

detectShellFunction · 0.85
logForDebuggingFunction · 0.70
execFileNoThrowFunction · 0.70

Tested by

no test coverage detected