Skip to content

Commit

Permalink
fix(cli): remove global prisma 1 detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolg42 committed Mar 30, 2021
1 parent f4a3308 commit ee4e9cb
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions src/packages/cli/scripts/preinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ function isPackageInstalledGlobally(name) {
}

function prismaIsInstalledGlobally() {
const prismaInstalledGlobally = isPackageInstalledGlobally('prisma')
if (prismaInstalledGlobally) {
return {
...prismaInstalledGlobally,
name: 'prisma',
}
}

const prisma2InstalledGlobally = isPackageInstalledGlobally('prisma2')
if (prisma2InstalledGlobally) {
return {
Expand Down Expand Up @@ -168,45 +160,6 @@ Then install ${white('prisma')} to continue using ${b('Prisma 2.0')}:
${white('npx prisma --help')}
Learn more here: https://pris.ly/preview025
`
} else {
message = `
You seem to have a global installation of Prisma 1 package ${white('prisma')}.
As Prisma 2 uses the same executable ${white(
'prisma',
)}, this would lead to a conflict.
To keep using Prisma 1, install the new package ${white(
'prisma1',
)} that we created.
It exposes the executable ${white('prisma1')}.
# Uninstall old Prisma 1 CLI
${white(
installedGlobally.pkgManager === 'yarn'
? 'yarn global remove prisma'
: 'npm uninstall -g prisma',
)}
# Install new Prisma 1 CLI
${white(
installedGlobally.pkgManager === 'yarn'
? 'yarn global add prisma1'
: 'npm install -g prisma1',
)}
# Use the Prisma 1 CLI
${white('prisma1 --help')}
Then you can install Prisma 2:
# Install Prisma 2 CLI
${white(`npm install prisma${isDev ? '@dev' : ''} --save-dev`)}
# Invoke via npx
${white('npx prisma --help')}
Learn more here: https://pris.ly/prisma1
`
}

Expand Down

0 comments on commit ee4e9cb

Please sign in to comment.