@@ -74,6 +74,9 @@ export async function cloneLlamaCppRepo(
74
74
75
75
await simpleGit ( llamaCppDirectory ) . removeRemote ( "origin" ) ;
76
76
} ) ;
77
+
78
+ await updateClonedLlamaCppRepoTagFile ( githubOwner , githubRepo , tag ) ;
79
+
77
80
return ;
78
81
} catch ( err ) {
79
82
await fs . remove ( llamaCppDirectory ) ;
@@ -94,23 +97,10 @@ export async function cloneLlamaCppRepo(
94
97
"--quiet" : null
95
98
} ) ;
96
99
} ) ;
97
- } catch ( err ) {
98
- printCloneErrorHelp ( String ( err ) ) ;
99
-
100
- throw err ;
101
- }
102
100
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 ) ;
112
102
} catch ( err ) {
113
- console . error ( getConsoleLogPrefix ( ) + "Failed to write llama.cpp tag file" , err ) ;
103
+ printCloneErrorHelp ( String ( err ) ) ;
114
104
115
105
throw err ;
116
106
}
@@ -188,3 +178,20 @@ export async function ensureLlamaCppRepoIsCloned({progressLogs = true}: {progres
188
178
189
179
await cloneLlamaCppRepo ( githubOwner , githubRepo , releaseTag , true , progressLogs ) ;
190
180
}
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