@code-pushup/cli 0.3.0 → 0.3.1

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 +12 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -619,6 +619,14 @@ async function readJsonFile(path) {
619
619
  const text = await readTextFile(path);
620
620
  return JSON.parse(text);
621
621
  }
622
+ async function fileExists(path) {
623
+ try {
624
+ const stats = await stat(path);
625
+ return stats.isFile();
626
+ } catch {
627
+ return false;
628
+ }
629
+ }
622
630
  async function ensureDirectoryExists(baseDir) {
623
631
  try {
624
632
  await mkdir(baseDir, { recursive: true });
@@ -1601,7 +1609,7 @@ function auditOutputsCorrelateWithPluginOutput(auditOutputs, pluginConfigAudits)
1601
1609
 
1602
1610
  // packages/core/package.json
1603
1611
  var name = "@code-pushup/core";
1604
- var version = "0.3.0";
1612
+ var version = "0.3.1";
1605
1613
 
1606
1614
  // packages/core/src/lib/implementation/collect.ts
1607
1615
  async function collect(options2) {
@@ -1736,18 +1744,16 @@ async function collectAndPersistReports(options2) {
1736
1744
  }
1737
1745
 
1738
1746
  // packages/core/src/lib/implementation/read-code-pushup-config.ts
1739
- import { stat as stat3 } from "fs/promises";
1740
1747
  var ConfigPathError = class extends Error {
1741
1748
  constructor(configPath) {
1742
- super(`Config path ${configPath} is not a file.`);
1749
+ super(`Provided path '${configPath}' is not valid.`);
1743
1750
  }
1744
1751
  };
1745
1752
  async function readCodePushupConfig(filepath) {
1746
1753
  if (!filepath.length) {
1747
- throw new Error("No filepath provided");
1754
+ throw new Error("The configuration path is empty.");
1748
1755
  }
1749
- const isFile = (await stat3(filepath)).isFile();
1750
- if (!isFile) {
1756
+ if (!await fileExists(filepath)) {
1751
1757
  throw new ConfigPathError(filepath);
1752
1758
  }
1753
1759
  return importEsmModule(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-pushup/cli",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "bin": {
5
5
  "code-pushup": "index.js"
6
6
  },