ai-heatmap 1.17.6 → 1.17.8
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 +1 -1
- package/scripts/generate.mjs +14 -1
package/package.json
CHANGED
package/scripts/generate.mjs
CHANGED
|
@@ -59,7 +59,20 @@ if (!mergeOnly) {
|
|
|
59
59
|
if (untilFlag) cmd += ` ${untilFlag}`;
|
|
60
60
|
|
|
61
61
|
console.log(`Running: ${cmd}`);
|
|
62
|
-
|
|
62
|
+
let raw;
|
|
63
|
+
try {
|
|
64
|
+
raw = execSync(cmd, { encoding: "utf-8", timeout: 300000 });
|
|
65
|
+
} catch (err) {
|
|
66
|
+
if (err.code === "ETIMEDOUT" || err.signal === "SIGTERM") {
|
|
67
|
+
console.error("\nError: ccusage timed out after 5 minutes.");
|
|
68
|
+
console.error("This may be caused by a slow network or npm registry issue.");
|
|
69
|
+
console.error("Try running manually: npx clear-npx-cache && npx --yes ccusage@latest daily --json");
|
|
70
|
+
} else {
|
|
71
|
+
console.error("\nError running ccusage:", err.message);
|
|
72
|
+
if (err.stderr) console.error(err.stderr);
|
|
73
|
+
}
|
|
74
|
+
process.exit(1);
|
|
75
|
+
}
|
|
63
76
|
const { daily } = JSON.parse(raw);
|
|
64
77
|
|
|
65
78
|
const costs = daily.map((d) => d.totalCost);
|