How to use the @prisma/cli.unknownCommand function in @prisma/cli

To help you get started, weโ€™ve selected a few @prisma/cli examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github prisma / prisma2 / cli / prisma2 / src / CLI.ts View on Github external
await download({
          binaries: {
            'query-engine': binaryPath,
            'migration-engine': binaryPath,
            'introspection-engine': binaryPath,
          },
          showProgress: true,
          version,
          failSilent: false,
        })
      }

      return cmd.parse(args._.slice(1))
    }
    // unknown command
    return unknownCommand(CLI.help, args._[0])
  }
github prisma / lift / src / cli / commands / LiftCommand.ts View on Github external
}
    // check if we have that subcommand
    const cmd = this.cmds[args._[0]]
    if (cmd) {
      const nextFreePort = await getNextFreePort(process.cwd())
      if (typeof nextFreePort !== 'number') {
        const command = `prisma2 lift ${argv.join(' ')}`
        throw new Error(`Cannot run ${chalk.bold(command)} because there is a ${chalk.bold(
          'prisma2 dev',
        )} command running in this directory.
Please ${gamboge(`stop ${chalk.bold('prisma2 dev')} first`)}, then try ${chalk.greenBright.bold(command)} again`)
      }
      return cmd.parse(args._.slice(1))
    }

    return unknownCommand(LiftCommand.help, args._[0])
  }

@prisma/cli

Prisma is an open-source database toolkit. It includes a JavaScript/TypeScript ORM for Node.js, migrations and a modern GUI to view and edit the data in your database. You can use Prisma in new projects or add it to an existing one.

Apache-2.0
Latest version published 4 years ago

Package Health Score

65 / 100
Full package analysis