nexus-prisma-generate
Advanced tools
Comparing version 0.3.6 to 0.3.7
@@ -22,4 +22,4 @@ "use strict"; | ||
function readPrismaYml(prismaYamlPath) { | ||
var configPath = prismaYamlPath ? prismaYamlPath : findPrismaConfigFile(); | ||
if (!configPath || (configPath && !fs.existsSync(configPath))) { | ||
var configPath = findPrismaConfigFile(prismaYamlPath); | ||
if (!configPath) { | ||
throw new Error('Could not find `prisma.yml` file'); | ||
@@ -48,3 +48,6 @@ } | ||
exports.readPrismaYml = readPrismaYml; | ||
function findPrismaConfigFile() { | ||
function findPrismaConfigFile(prismaYmlPath) { | ||
if (prismaYmlPath && !fs.existsSync(prismaYmlPath)) { | ||
return null; | ||
} | ||
var definitionPath = path.join(process.cwd(), 'prisma.yml'); | ||
@@ -51,0 +54,0 @@ if (fs.existsSync(definitionPath)) { |
@@ -37,12 +37,11 @@ #!/usr/bin/env node | ||
} | ||
var cwd = process.cwd(); | ||
var rootPath = config_1.findRootDirectory(); | ||
var resolvedPrismaYmlPath = prismaYmlPath !== undefined | ||
? prismaYmlPath.startsWith('/') | ||
? prismaYmlPath | ||
: path_1.join(cwd, prismaYmlPath) | ||
: path_1.join(rootPath, prismaYmlPath) | ||
: undefined; | ||
var prisma = config_1.readPrismaYml(resolvedPrismaYmlPath); | ||
var rootPath = config_1.findRootDirectory(); | ||
var resolvedOutput = output.startsWith('/') ? output : path_1.join(cwd, output); | ||
var resolvedPrismaClientDir = config_1.getPrismaClientDir(prismaClientDir, prisma, cwd); | ||
var resolvedOutput = output.startsWith('/') ? output : path_1.join(rootPath, output); | ||
var resolvedPrismaClientDir = config_1.getPrismaClientDir(prismaClientDir, prisma, rootPath); | ||
try { | ||
@@ -49,0 +48,0 @@ // Create the output directories if needed (mkdir -p) |
{ | ||
"name": "nexus-prisma-generate", | ||
"version": "0.3.6", | ||
"version": "0.3.7", | ||
"typings": "dist/index.d.ts", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
433
35969