Skip to content

Commit 64b34a4

Browse files
authored
fix(cli): update publish success warn info (#422)
1 parent df89bc4 commit 64b34a4

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/cli/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
abbreviateCommitHash,
1414
extractOwnerAndRepo,
1515
extractRepository,
16+
installCommands,
1617
} from "@pkg-pr-new/utils";
1718
import { glob } from "tinyglobby";
1819
import ignore from "ignore";
@@ -549,7 +550,7 @@ const main = defineCommand({
549550
return `${packageName}:
550551
- sha: ${shasums[packageName]}
551552
- publint: ${publintUrl}
552-
- npm: npm i ${url}`;
553+
- ${packMethod}: ${installCommands[packMethod]} ${url}`;
553554
})
554555
.join("\n\n");
555556

packages/utils/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ export function isPullRequest(ref: string) {
3737
export type Comment = "off" | "create" | "update";
3838
export type PackageManager = "npm" | "pnpm" | "yarn" | "bun";
3939

40+
export const installCommands: Record<PackageManager, string> = {
41+
npm: "npm i",
42+
pnpm: "pnpm add",
43+
yarn: "yarn add",
44+
bun: "bun add",
45+
};
46+
4047
const whitelist =
4148
"https://raw.githubusercontent.com/stackblitz-labs/pkg.pr.new/main/.whitelist";
4249

0 commit comments

Comments
 (0)