MCPcopy
hub / github.com/prisma/prisma / makeInstallCommand

Function makeInstallCommand

packages/cli/src/utils/printUpdateMessage.ts:51–74  ·  view source on GitHub ↗
(
  packageName: string,
  tag: string,
  options = {
    canBeGlobal: true,
    canBeDev: true,
  },
)

Source from the content-addressed store, hash-verified

49}
50
51function makeInstallCommand(
52 packageName: string,
53 tag: string,
54 options = {
55 canBeGlobal: true,
56 canBeDev: true,
57 },
58): string {
59 let command = ''
60 if (isPrismaInstalledGlobally === 'npm' && options.canBeGlobal) {
61 command = `npm i -g ${packageName}`
62 } else if (options.canBeDev) {
63 command = `npm i --save-dev ${packageName}`
64 } else {
65 command = `npm i ${packageName}`
66 }
67
68 // always output tag (so major upgrades work)
69 // see https://www.npmjs.com/package/prisma?activeTab=versions
70 // (can only be latest or dev via checkpoint-server)
71 command += `@${tag}`
72
73 return command
74}

Callers 1

printUpdateMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected