Skip to content

Commit

Permalink
Merge pull request #111 from zowe-actions/fix/vsce-publish-prerelease2
Browse files Browse the repository at this point in the history
Support prerelease flag for packaging VSIXs
  • Loading branch information
t1m0thyj committed Sep 5, 2023
2 parents fe0b3dc + f55db52 commit ff69224
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion dist/vsce.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions packages/vsce/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,14 @@ export async function vsceInfo(extensionName: string): Promise<Record<string, an
} catch { /* Do nothing */ }
}

export async function vscePackage(context?: IContext): Promise<string> {
export async function vscePackage(context: IContext): Promise<string> {
const cmdArgs = ["vsce", "package"];
if (fs.existsSync(path.join(context?.rootDir || "", "yarn.lock"))) {
if (fs.existsSync(path.join(context.rootDir, "yarn.lock"))) {
cmdArgs.push("--yarn");
}
if (context.version.prerelease != null) {
cmdArgs.push("--pre-release");
}
const cmdOutput = await exec.getExecOutput("npx", cmdArgs);
return cmdOutput.stdout.trim().match(/Packaged: (.*\.vsix)/)?.[1] as string;
}
Expand Down

0 comments on commit ff69224

Please sign in to comment.