Skip to content

Commit 87873ae

Browse files
committed
fix: redact secrets before truncating and skip npm/pypi in openclaw binary test
Signed-off-by: Maxime Grenu <maxime.grenu@gmail.com>
1 parent 2b9d45e commit 87873ae

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

bin/lib/runner.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function run(cmd, opts = {}) {
4949
env: { ...process.env, ...opts.env },
5050
});
5151
if (result.status !== 0 && !opts.ignoreError) {
52-
console.error(` Command failed (exit ${result.status}): ${redactSecrets(cmd.slice(0, 80))}`);
52+
console.error(` Command failed (exit ${result.status}): ${redactSecrets(cmd).slice(0, 80)}`);
5353
process.exit(result.status || 1);
5454
}
5555
return result;
@@ -64,7 +64,7 @@ function runInteractive(cmd, opts = {}) {
6464
env: { ...process.env, ...opts.env },
6565
});
6666
if (result.status !== 0 && !opts.ignoreError) {
67-
console.error(` Command failed (exit ${result.status}): ${redactSecrets(cmd.slice(0, 80))}`);
67+
console.error(` Command failed (exit ${result.status}): ${redactSecrets(cmd).slice(0, 80)}`);
6868
process.exit(result.status || 1);
6969
}
7070
return result;

test/policies.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ describe("policies", () => {
201201
});
202202

203203
it("every preset binaries section includes openclaw", () => {
204+
const skip = ["npm", "pypi"];
204205
for (const p of policies.listPresets()) {
206+
if (skip.includes(p.name)) continue;
205207
const content = policies.loadPreset(p.name);
206208
expect(content.includes("/usr/local/bin/openclaw")).toBeTruthy();
207209
}

0 commit comments

Comments
 (0)