Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Avaray committed Nov 30, 2024
1 parent d14b994 commit 5ea17fc
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
getIds,
getBranchName,
getEnvironmentVariable,
normalizeFilename,
runtime,
saveFile,
pvsUrl,
Expand Down Expand Up @@ -257,16 +256,20 @@ for (const ui of uis) {
);

if (template.id) {
console.log(`Template ${template.id} created successfully`);
templates[checkpoint.id!] = {
vastai: {
[ui.id]: template.id
}
console.log(`Template for ${ui.name}UI with ${checkpoint.name} created with id ${template.id}`);
// templates[checkpoint.id!].vastai[ui.id] = template.id;
if (!templates[checkpoint.id!]) {
templates[checkpoint.id!] = { vastai: {} };
}
if (!templates[checkpoint.id!].vastai) {
templates[checkpoint.id!].vastai = {};
}
templates[checkpoint.id!].vastai[ui.id] = template.id;
}
}
}


await saveFile("data/templates.json", JSON.stringify(templates, null, 2));

console.log("Done");

0 comments on commit 5ea17fc

Please sign in to comment.