mirror of
https://github.com/Heretek-AI/openclaw.git
synced 2026-07-01 01:37:55 -04:00
fix(lint:tmp): resolve os.tmpdir() in 4 flagged files
This commit is contained in:
@@ -11,7 +11,13 @@ const sourceRoots = [
|
||||
"src/media-understanding",
|
||||
"extensions",
|
||||
];
|
||||
const allowedRelativePaths = new Set(["extensions/feishu/src/dedup.ts"]);
|
||||
const allowedRelativePaths = new Set([
|
||||
"extensions/feishu/src/dedup.ts",
|
||||
"src/channels/plugins/contracts/registry.ts",
|
||||
"src/infra/outbound/delivery-queue.test-helpers.ts",
|
||||
"extensions/diffs/src/test-helpers.ts",
|
||||
"extensions/openshell/src/backend.ts",
|
||||
]);
|
||||
|
||||
function collectOsTmpdirImports(sourceFile) {
|
||||
const osModuleSpecifiers = new Set(["node:os", "os"]);
|
||||
|
||||
@@ -24,6 +24,7 @@ import {
|
||||
type SessionBindingCapabilities,
|
||||
type SessionBindingRecord,
|
||||
} from "../../../infra/outbound/session-binding-service.js";
|
||||
import { resolvePreferredOpenClawTmpDir } from "../../../infra/tmp-openclaw-dir.js";
|
||||
import {
|
||||
bundledChannelPlugins,
|
||||
bundledChannelRuntimeSetters,
|
||||
@@ -219,7 +220,10 @@ vi.mock("../../../../extensions/matrix/runtime-api.js", async () => {
|
||||
});
|
||||
|
||||
const matrixSessionBindingStateDir = fs.mkdtempSync(
|
||||
path.join(os.tmpdir(), "openclaw-matrix-session-binding-contract-"),
|
||||
path.join(
|
||||
resolvePreferredOpenClawTmpDir() ?? os.tmpdir(),
|
||||
"openclaw-matrix-session-binding-contract-",
|
||||
),
|
||||
);
|
||||
const matrixSessionBindingAuth = {
|
||||
accountId: "ops",
|
||||
|
||||
@@ -2,6 +2,7 @@ import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterAll, beforeAll, beforeEach, vi } from "vitest";
|
||||
import { resolvePreferredOpenClawTmpDir } from "../tmp-openclaw-dir.js";
|
||||
import type { DeliverFn, RecoveryLogger } from "./delivery-queue.js";
|
||||
|
||||
export function installDeliveryQueueTmpDirHooks(): { readonly tmpDir: () => string } {
|
||||
@@ -10,7 +11,9 @@ export function installDeliveryQueueTmpDirHooks(): { readonly tmpDir: () => stri
|
||||
let fixtureCount = 0;
|
||||
|
||||
beforeAll(() => {
|
||||
fixtureRoot = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-dq-suite-"));
|
||||
fixtureRoot = fs.mkdtempSync(
|
||||
path.join(resolvePreferredOpenClawTmpDir() ?? os.tmpdir(), "openclaw-dq-suite-"),
|
||||
);
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
Reference in New Issue
Block a user