Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Nov 20, 2019
1 parent 34f5e82 commit bbbb6ae
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions cli/generator-helper/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,5 @@ export type GeneratorManifest = {
}
requiresGenerators?: string[]
requiresEngines?: EngineType[]
version?: string
}
2 changes: 1 addition & 1 deletion cli/introspection/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prisma/introspection",
"version": "0.0.120",
"version": "0.0.121",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "Apache-2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ const Step60DownloadExample: React.FC = () => {

await makeDir(state.outputDir)

const tarFile = await downloadRepo('prisma', 'prisma-examples', examples!.meta.branch)
const tarFile = await downloadRepo(
'prisma',
'prisma-examples',
process.env.PRISMA_EXAMPLES_BRANCH || examples!.meta.branch,
)
setActiveIndex(1)
await extractExample(tarFile, selectedExample!.path, state.outputDir)

Expand Down
2 changes: 1 addition & 1 deletion cli/prisma2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prisma2",
"version": "2.0.0-alpha.334",
"version": "2.0.0-alpha.335",
"main": "build/index.js",
"repository": "git@github.com:prisma/prisma2-cli.git",
"author": "Tim Suchanek <suchanek@prisma.io>",
Expand Down
11 changes: 11 additions & 0 deletions cli/prisma2/src/Generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ export class Generate implements Command {
? chalk.dim(` to ./${path.relative(process.cwd(), generator.options!.generator.output!)}`)
: ''
const name = generator.manifest ? generator.manifest.prettyName : generator.options!.generator.provider
if (
generator.manifest?.version &&
generator.manifest?.version !== pkg.version &&
generator.options?.generator.provider === 'photonjs'
) {
throw new Error(
`${chalk.bold(`@prisma/photon@${generator.manifest?.version}`)} is not compatible with ${chalk.bold(
`prisma2@${pkg.version}`,
)}. Their versions need to be equal.`,
)
}
console.log(`Generating ${chalk.bold(name!)}${toStr}`)
const before = Date.now()
await generator.generate()
Expand Down

0 comments on commit bbbb6ae

Please sign in to comment.