nexus-prisma-generate
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -29,4 +29,4 @@ #!/usr/bin/env node | ||
var _a = cli.flags, prismaClientDir = _a.client, output = _a.output, jsMode = _a.js; | ||
if (!prismaClientDir || !fs_1.existsSync(prismaClientDir)) { | ||
console.log('ERROR: Missing or invalid argument --client'); | ||
if (!prismaClientDir) { | ||
console.log('ERROR: Missing argument --client'); | ||
process.exit(1); | ||
@@ -42,2 +42,9 @@ } | ||
: path_1.join(rootPath, output); | ||
var resolvedPrismaClientDir = prismaClientDir.startsWith('/') | ||
? prismaClientDir | ||
: path_1.join(rootPath, prismaClientDir); | ||
if (!fs_1.existsSync(resolvedPrismaClientDir)) { | ||
console.log("ERROR: Cannot find --client path at " + resolvedPrismaClientDir); | ||
process.exit(1); | ||
} | ||
// Create the output directories if needed (mkdir -p) | ||
@@ -50,3 +57,3 @@ fs_1.mkdirSync(resolvedOutput, { recursive: true }); | ||
var nexusPrismaTypesPath = path_1.join(rootPath, output, 'nexus-prisma.ts'); | ||
var nexusPrismaTypes = renderNexusPrismaTypes(schema, config_1.getImportPathRelativeToOutput(prismaClientDir, nexusPrismaTypesPath), renderedDatamodel, jsMode); | ||
var nexusPrismaTypes = renderNexusPrismaTypes(schema, config_1.getImportPathRelativeToOutput(resolvedPrismaClientDir, nexusPrismaTypesPath), renderedDatamodel, jsMode); | ||
fs_1.writeFileSync(nexusPrismaTypesPath, nexusPrismaTypes); | ||
@@ -53,0 +60,0 @@ if (jsMode) { |
{ | ||
"name": "nexus-prisma-generate", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"typings": "dist/index.d.ts", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
43358
620