Skip to content

Commit

Permalink
fix(main): warn when running the bare module; upgrade prisma (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
steebchen committed May 29, 2020
1 parent 29caabd commit 5f4eb61
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions binaries/binaries.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import (
)

// PrismaVersion is a hardcoded version of the Prisma CLI.
const PrismaVersion = "2.0.0-alpha.1253"
const PrismaVersion = "2.0.0-alpha.1265"

// EngineVersion is a hardcoded version of the Prisma Engine.
// The versions can be found under https://github.com/prisma/prisma-engine/commits/master.
const EngineVersion = "c48b94aa8d1d9a0e5582dcd14e25202b76303dca"
const EngineVersion = "4dbefe724ae6df3621eb660a5d0e0402e34189bf"

// PrismaURL points to an S3 bucket URL where the CLI binaries are stored.
var PrismaURL = "https://prisma-photongo.s3-eu-west-1.amazonaws.com/%s-%s-%s.gz"
Expand Down
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ func main() {

logger.Debug.Printf("invoking prisma")

// if this wasn't actually invoked by the prisma generator, print a warning and exit
if os.Getenv("PRISMA_GENERATOR_INVOCATION") == "" {
logger.Info.Printf("This command is only meant to be invoked internally. Please run the following instead:")
logger.Info.Printf("`go run github.com/prisma/prisma-client-go <command>`")
logger.Info.Printf("e.g.")
logger.Info.Printf("`go run github.com/prisma/prisma-client-go generate`")
os.Exit(1)
}

// exit when signal triggers
c := make(chan os.Signal)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
Expand Down

0 comments on commit 5f4eb61

Please sign in to comment.