Skip to content

Commit

Permalink
improve download script
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Feb 7, 2020
1 parent 29c46da commit b4c0a88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli/prisma2/scripts/download.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const { download } = require('@prisma/fetch-engine')
const pkg = require('../package.json')
const fs = require('fs')
const path = require('path')
const pkgUp = require('pkg-up')
const Debug = require('debug')
const debug = Debug('prisma2:download')

const binaryPath = eval(`require('path').join(__dirname, '../')`)
const pkg = eval(`require(require('path').join(binaryPath, 'package.json'))`)

const version = (pkg && pkg.prisma && pkg.prisma.version) || 'latest'

Expand All @@ -29,7 +29,7 @@ if (process.env.INIT_CWD && process.env.NOW_BUILDER) {
}

async function ensurePostInstall() {
const initPkgPath = path.resolve(process.env.INIT_CWD, 'package.json')
const initPkgPath = eval(`require('path').resolve(process.env.INIT_CWD, 'package.json')`)
if (fs.existsSync(initPkgPath)) {
if (addPostInstallHook(initPkgPath)) {
return
Expand Down

0 comments on commit b4c0a88

Please sign in to comment.