prisma-client-php 2.3.2 → 2.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/generate.js CHANGED
@@ -2,16 +2,27 @@ import*as fs from"fs";import{exec}from"child_process";import path from"path";imp
2
2
  const executePHP = (command) => {
3
3
  exec(command, (error, stdout, stderr) => {
4
4
  if (error) {
5
- console.error(`Execution error: ${error}`);
5
+ if (stderr?.trim()) console.error(stderr);
6
+ console.error(`Execution error: ${error.message}`);
6
7
  return;
7
8
  }
8
- if (stderr) {
9
- console.error(`Standard error: ${stderr}`);
10
- return;
9
+ if (stderr?.trim()) {
10
+ const filtered = stderr
11
+ .split(/\r?\n/)
12
+ .filter(
13
+ (line) =>
14
+ line.trim() &&
15
+ !/Loaded Prisma config from/i.test(line) &&
16
+ !/Prisma config detected, skipping environment variable loading/i.test(
17
+ line
18
+ )
19
+ )
20
+ .join("\n");
21
+ if (filtered) console.warn(filtered);
11
22
  }
12
23
  if (stdout.includes("Result: Prisma schema is valid.")) {
13
- console.error(chalk.blue(stdout));
14
- } else {
24
+ console.log(chalk.blue(stdout));
25
+ } else if (stdout.trim()) {
15
26
  console.log(`Standard output...\n${stdout}`);
16
27
  }
17
28
  });