@code-pushup/cli 0.3.0 → 0.3.2
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/index.js +12 -6
- 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.
|
|
1612
|
+
var version = "0.3.2";
|
|
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(`
|
|
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("
|
|
1754
|
+
throw new Error("The configuration path is empty.");
|
|
1748
1755
|
}
|
|
1749
|
-
|
|
1750
|
-
if (!isFile) {
|
|
1756
|
+
if (!await fileExists(filepath)) {
|
|
1751
1757
|
throw new ConfigPathError(filepath);
|
|
1752
1758
|
}
|
|
1753
1759
|
return importEsmModule(
|