From 338a1522dae2779735ecf621e43bad379d7a4836 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 17 Aug 2023 11:34:53 -0400 Subject: [PATCH] Support prerelease flag for publishing VSIXs Signed-off-by: Timothy Johnson --- dist/vsce.js | 6 ++++++ packages/vsce/src/utils.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/dist/vsce.js b/dist/vsce.js index e5cbb7b..d0da2a6 100644 --- a/dist/vsce.js +++ b/dist/vsce.js @@ -1149,6 +1149,9 @@ function ovsxPublish(context, vsixPath) { } else if (fs.existsSync(path.join(context.rootDir, "yarn.lock"))) { cmdArgs.push("--yarn"); } + if (context.version.prerelease != null) { + cmdArgs.push("--pre-release"); + } yield import_core.utils.dryRunTask(context, `npx ${cmdArgs.join(" ")}`, () => __async(this, null, function* () { yield exec.exec("npx", cmdArgs); })); @@ -1179,6 +1182,9 @@ function vscePublish(context, vsixPath) { } else if (fs.existsSync(path.join(context.rootDir, "yarn.lock"))) { cmdArgs.push("--yarn"); } + if (context.version.prerelease != null) { + cmdArgs.push("--pre-release"); + } yield import_core.utils.dryRunTask(context, `npx ${cmdArgs.join(" ")}`, () => __async(this, null, function* () { yield exec.exec("npx", cmdArgs); })); diff --git a/packages/vsce/src/utils.ts b/packages/vsce/src/utils.ts index 3a4e4e1..a3b85a1 100644 --- a/packages/vsce/src/utils.ts +++ b/packages/vsce/src/utils.ts @@ -31,6 +31,9 @@ export async function ovsxPublish(context: IContext, vsixPath?: string): Promise } else if (fs.existsSync(path.join(context.rootDir, "yarn.lock"))) { cmdArgs.push("--yarn"); } + if (context.version.prerelease != null) { + cmdArgs.push("--pre-release"); + } await utils.dryRunTask(context, `npx ${cmdArgs.join(" ")}`, async () => { await exec.exec("npx", cmdArgs); }); @@ -57,6 +60,9 @@ export async function vscePublish(context: IContext, vsixPath?: string): Promise } else if (fs.existsSync(path.join(context.rootDir, "yarn.lock"))) { cmdArgs.push("--yarn"); } + if (context.version.prerelease != null) { + cmdArgs.push("--pre-release"); + } await utils.dryRunTask(context, `npx ${cmdArgs.join(" ")}`, async () => { await exec.exec("npx", cmdArgs); });