File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff 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(
7779export 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 }
You can’t perform that action at this time.
0 commit comments