@@ -74,6 +74,9 @@ export async function cloneLlamaCppRepo(
7474
7575 await simpleGit ( llamaCppDirectory ) . removeRemote ( "origin" ) ;
7676 } ) ;
77+
78+ await updateClonedLlamaCppRepoTagFile ( githubOwner , githubRepo , tag ) ;
79+
7780 return ;
7881 } catch ( err ) {
7982 await fs . remove ( llamaCppDirectory ) ;
@@ -94,23 +97,10 @@ export async function cloneLlamaCppRepo(
9497 "--quiet" : null
9598 } ) ;
9699 } ) ;
97- } catch ( err ) {
98- printCloneErrorHelp ( String ( err ) ) ;
99-
100- throw err ;
101- }
102100
103- try {
104- const clonedLlamaCppRepoTagJson : ClonedLlamaCppRepoTagFile = {
105- tag,
106- llamaCppGithubRepo : githubOwner + "/" + githubRepo
107- } ;
108-
109- await fs . writeJson ( llamaCppDirectoryInfoFilePath , clonedLlamaCppRepoTagJson , {
110- spaces : 4
111- } ) ;
101+ await updateClonedLlamaCppRepoTagFile ( githubOwner , githubRepo , tag ) ;
112102 } catch ( err ) {
113- console . error ( getConsoleLogPrefix ( ) + "Failed to write llama.cpp tag file" , err ) ;
103+ printCloneErrorHelp ( String ( err ) ) ;
114104
115105 throw err ;
116106 }
@@ -188,3 +178,20 @@ export async function ensureLlamaCppRepoIsCloned({progressLogs = true}: {progres
188178
189179 await cloneLlamaCppRepo ( githubOwner , githubRepo , releaseTag , true , progressLogs ) ;
190180}
181+
182+ async function updateClonedLlamaCppRepoTagFile ( githubOwner : string , githubRepo : string , tag : string ) {
183+ try {
184+ const clonedLlamaCppRepoTagJson : ClonedLlamaCppRepoTagFile = {
185+ tag,
186+ llamaCppGithubRepo : githubOwner + "/" + githubRepo
187+ } ;
188+
189+ await fs . writeJson ( llamaCppDirectoryInfoFilePath , clonedLlamaCppRepoTagJson , {
190+ spaces : 4
191+ } ) ;
192+ } catch ( err ) {
193+ console . error ( getConsoleLogPrefix ( ) + "Failed to write llama.cpp tag file" , err ) ;
194+
195+ throw err ;
196+ }
197+ }
0 commit comments