@seniorsistemas/semantic-release-maven-config 3.0.2 → 3.0.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.
Files changed (2) hide show
  1. package/index.js +15 -16
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -2,7 +2,7 @@ const commonConfig = require("@seniorsistemas/semantic-release-common-config");
2
2
  const https = require("https");
3
3
  const fs = require("fs");
4
4
  const path = require("path");
5
- const { execSync, execFileSync } = require("child_process");
5
+ const { execSync, spawn } = require("child_process");
6
6
 
7
7
  const NEXUS_BASE = "https://nexus.senior.com.br";
8
8
  const SEARCH_PATH =
@@ -85,26 +85,25 @@ module.exports = {
85
85
  }
86
86
 
87
87
  logger.log("Running: seniorops generate --ecosystem %s --type %s", ECOSYSTEM, TYPE);
88
- try {
89
- const generateOutput = execFileSync(
88
+ await new Promise((resolve, reject) => {
89
+ const child = spawn(
90
90
  BINARY_PATH,
91
- ["generate"],
91
+ ["generate", "--ecosystem", ECOSYSTEM, "--type", TYPE],
92
92
  {
93
93
  env: { ...process.env, ECOSYSTEM, TYPE, GITHUB_REF_NAME: nextRelease.version, GITHUB_REF: `refs/tags/${nextRelease.version}`, GITHUB_REF_TYPE: "tag" },
94
- stdio: "pipe",
95
94
  }
96
95
  );
97
- if (generateOutput && generateOutput.length) {
98
- logger.log("seniorops output:\n%s", generateOutput.toString());
99
- }
100
- } catch (err) {
101
- const stdout = err.stdout ? err.stdout.toString() : "";
102
- const stderr = err.stderr ? err.stderr.toString() : "";
103
- logger.error("seniorops generate failed (exit code %d)", err.status);
104
- if (stdout) logger.error("stdout:\n%s", stdout);
105
- if (stderr) logger.error("stderr:\n%s", stderr);
106
- throw err;
107
- }
96
+ child.stdout.on("data", (data) => logger.log(data.toString()));
97
+ child.stderr.on("data", (data) => logger.error(data.toString()));
98
+ child.on("error", reject);
99
+ child.on("close", (code) => {
100
+ if (code !== 0) {
101
+ reject(new Error(`seniorops generate exited with code ${code}`));
102
+ } else {
103
+ resolve();
104
+ }
105
+ });
106
+ });
108
107
 
109
108
  logger.log("Replacing Nexus URLs in pom.xml files");
110
109
  try {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@seniorsistemas/semantic-release-maven-config",
3
3
  "description": "semantic-release shareable config to create maven packages with Senior GitLab",
4
- "version": "3.0.2",
4
+ "version": "3.0.4",
5
5
  "main": "index.js",
6
6
  "files": [
7
7
  "index.js"