@docupace/pipeline 1.0.0-alpha.35 → 1.0.0-alpha.36

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docupace/pipeline",
3
- "version": "1.0.0-alpha.35",
3
+ "version": "1.0.0-alpha.36",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -12,8 +12,7 @@ export async function validateChangesets(directoryPath) {
12
12
  let preJson;
13
13
 
14
14
  if (!fs.existsSync(preJsonPath) && mdFiles.length === 0) {
15
- console.error("Error: No pre.json and no md files found.");
16
- process.exit(1);
15
+ throw new Error("Error: No pre.json and no md files found.")
17
16
  }
18
17
 
19
18
  if (fs.existsSync(preJsonPath)) {
@@ -29,16 +28,15 @@ export async function validateChangesets(directoryPath) {
29
28
  const unmatchedFiles = mdFileNamesWithoutExt.filter(fileName => !changesetNames.includes(fileName));
30
29
 
31
30
  if (unmatchedFiles.length == 0) {
32
- console.error("No new MD files found:", unmatchedFiles);
33
- process.exit(1);
31
+ throw new Error("Error: No new MD files found:");
34
32
  }
35
33
  }
36
34
  }
37
35
 
38
36
  console.log("Validation successful.");
39
37
  } catch (error) {
40
- console.error("Error while processing:", error);
41
- process.exit(1);
38
+ console.log(error.message);
39
+ throw(error);
42
40
  }
43
41
  }
44
42