@fuzzle/opencode-accountant 0.10.2-next.1 → 0.10.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/dist/index.js +9 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -23078,12 +23078,19 @@ function findRulesForCsv(csvPath, mapping) {
|
|
|
23078
23078
|
|
|
23079
23079
|
// src/utils/hledgerExecutor.ts
|
|
23080
23080
|
var {$: $2 } = globalThis.Bun;
|
|
23081
|
+
var STDERR_TRUNCATE_LENGTH = 500;
|
|
23081
23082
|
var TX_HEADER_PATTERN = /^(\d{4})-(\d{2}-\d{2})(\s+(.+))?$/;
|
|
23082
23083
|
async function defaultHledgerExecutor(cmdArgs) {
|
|
23083
23084
|
try {
|
|
23084
23085
|
const result = await $2`hledger ${cmdArgs}`.quiet().nothrow();
|
|
23085
23086
|
const stdout = result.stdout.toString();
|
|
23086
23087
|
const stderr = result.stderr.toString();
|
|
23088
|
+
if (result.exitCode !== 0 && stderr) {
|
|
23089
|
+
process.stderr.write(`[hledger] command failed (exit ${result.exitCode}): hledger ${cmdArgs.join(" ")}
|
|
23090
|
+
`);
|
|
23091
|
+
process.stderr.write(`[hledger] stderr: ${stderr.slice(0, STDERR_TRUNCATE_LENGTH)}
|
|
23092
|
+
`);
|
|
23093
|
+
}
|
|
23087
23094
|
return {
|
|
23088
23095
|
stdout,
|
|
23089
23096
|
stderr,
|
|
@@ -23091,6 +23098,8 @@ async function defaultHledgerExecutor(cmdArgs) {
|
|
|
23091
23098
|
};
|
|
23092
23099
|
} catch (error45) {
|
|
23093
23100
|
const errorMessage = error45 instanceof Error ? error45.message : String(error45);
|
|
23101
|
+
process.stderr.write(`[hledger] exception: ${errorMessage}
|
|
23102
|
+
`);
|
|
23094
23103
|
return {
|
|
23095
23104
|
stdout: "",
|
|
23096
23105
|
stderr: errorMessage,
|