Skip to content

Commit d12aaa9

Browse files
committed
feat(mcp): Force update sources.tar
1 parent 11664d8 commit d12aaa9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mcp/docs.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ export async function ensureDocs(
3939
if (!isMcpMode) console.log(`Updating documentation for Zig version: ${zigVersion}`);
4040
const builtinFunctions = await extractBuiltinFunctions(zigVersion, isMcpMode);
4141

42+
await downloadSourcesTar(zigVersion, isMcpMode, true);
43+
4244
const dir = path.dirname(metadataPath);
4345
if (!fs.existsSync(dir)) {
4446
fs.mkdirSync(dir, { recursive: true });
@@ -77,12 +79,13 @@ export async function ensureDocs(
7779
export async function downloadSourcesTar(
7880
zigVersion: string,
7981
isMcpMode: boolean = false,
82+
forceUpdate: boolean = false,
8083
): Promise<Uint8Array> {
8184
const paths = envPaths("zig-mcp", { suffix: "" });
8285
const versionCacheDir = path.join(paths.cache, zigVersion);
8386
const sourcesPath = path.join(versionCacheDir, "sources.tar");
8487

85-
if (fs.existsSync(sourcesPath)) {
88+
if (fs.existsSync(sourcesPath) && !forceUpdate) {
8689
if (!isMcpMode) console.log(`Using cached sources.tar from ${sourcesPath}`);
8790
return new Uint8Array(fs.readFileSync(sourcesPath));
8891
}

0 commit comments

Comments
 (0)