mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 06:41:22 +00:00
fix: make windows CI path handling deterministic
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
isInterpreterLikeSafeBin,
|
||||
@@ -72,16 +73,18 @@ describe("exec safe-bin runtime policy", () => {
|
||||
});
|
||||
|
||||
it("merges explicit safe-bin trusted dirs from global and local config", () => {
|
||||
const customDir = path.join(path.sep, "custom", "bin");
|
||||
const agentDir = path.join(path.sep, "agent", "bin");
|
||||
const policy = resolveExecSafeBinRuntimePolicy({
|
||||
global: {
|
||||
safeBinTrustedDirs: [" /custom/bin ", "/custom/bin"],
|
||||
safeBinTrustedDirs: [` ${customDir} `, customDir],
|
||||
},
|
||||
local: {
|
||||
safeBinTrustedDirs: ["/agent/bin"],
|
||||
safeBinTrustedDirs: [agentDir],
|
||||
},
|
||||
});
|
||||
|
||||
expect(policy.trustedSafeBinDirs.has("/custom/bin")).toBe(true);
|
||||
expect(policy.trustedSafeBinDirs.has("/agent/bin")).toBe(true);
|
||||
expect(policy.trustedSafeBinDirs.has(path.resolve(customDir))).toBe(true);
|
||||
expect(policy.trustedSafeBinDirs.has(path.resolve(agentDir))).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user