@gearbox-protocol/deploy-tools 4.24.7 → 4.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +16 -7
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -366247,9 +366247,13 @@ var ForkTemplate = z.object({
|
|
|
366247
366247
|
var TemplateFile = z.array(ForkTemplate).min(1);
|
|
366248
366248
|
|
|
366249
366249
|
// src/commands/launch-forks/load-template.ts
|
|
366250
|
-
async function loadTemplate(file,
|
|
366250
|
+
async function loadTemplate(file, interpolations) {
|
|
366251
366251
|
let raw = await readFile7(file, "utf-8");
|
|
366252
|
-
|
|
366252
|
+
for (const [key, val] of Object.entries(interpolations)) {
|
|
366253
|
+
if (key && val) {
|
|
366254
|
+
raw = raw.replace(new RegExp(`%${key}`, "g"), val);
|
|
366255
|
+
}
|
|
366256
|
+
}
|
|
366253
366257
|
let parsed;
|
|
366254
366258
|
if (file.endsWith(".json")) {
|
|
366255
366259
|
parsed = JSON.parse(raw);
|
|
@@ -366257,9 +366261,9 @@ async function loadTemplate(file, release) {
|
|
|
366257
366261
|
parsed = (0, import_yaml.parse)(raw);
|
|
366258
366262
|
}
|
|
366259
366263
|
const forks = TemplateFile.parse(parsed);
|
|
366260
|
-
return forks.map((f) => expandTemplate(f,
|
|
366264
|
+
return forks.map((f) => expandTemplate(f, interpolations));
|
|
366261
366265
|
}
|
|
366262
|
-
function expandTemplate(template, release) {
|
|
366266
|
+
function expandTemplate(template, { release }) {
|
|
366263
366267
|
const { scripts: scriptz, ...rest } = template;
|
|
366264
366268
|
const scripts = scriptz.map(
|
|
366265
366269
|
(s) => ({
|
|
@@ -366296,10 +366300,15 @@ function launchForks() {
|
|
|
366296
366300
|
"--release <version>",
|
|
366297
366301
|
"release name to interpolate inside json files"
|
|
366298
366302
|
).default("")
|
|
366303
|
+
).addOption(
|
|
366304
|
+
new Option(
|
|
366305
|
+
"--comment <comment>",
|
|
366306
|
+
"comment to interpolate inside json files"
|
|
366307
|
+
).default("")
|
|
366299
366308
|
).action(async (opts) => {
|
|
366300
366309
|
const start = /* @__PURE__ */ new Date();
|
|
366301
|
-
const { endpoint, apiKey, release, template } = opts;
|
|
366302
|
-
const forks = await loadTemplate(template, release);
|
|
366310
|
+
const { endpoint, apiKey, release, comment, template } = opts;
|
|
366311
|
+
const forks = await loadTemplate(template, { release, comment });
|
|
366303
366312
|
console.log(`will create ${forks.length} forks`);
|
|
366304
366313
|
const resp = await fetch(endpoint, {
|
|
366305
366314
|
method: "POST",
|
|
@@ -366362,7 +366371,7 @@ function getRenderer(opts) {
|
|
|
366362
366371
|
}
|
|
366363
366372
|
|
|
366364
366373
|
// package.json
|
|
366365
|
-
var version3 = "4.
|
|
366374
|
+
var version3 = "4.25.1";
|
|
366366
366375
|
|
|
366367
366376
|
// src/version.ts
|
|
366368
366377
|
var version_default = version3;
|