mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-25 17:02:46 +00:00
test: repair current main gate regressions
This commit is contained in:
@@ -18,6 +18,14 @@ async function readCommandSource(relativePath: string): Promise<string> {
|
||||
const absolutePath = path.join(process.cwd(), relativePath);
|
||||
const source = await fs.readFile(absolutePath, "utf8");
|
||||
const reexportMatch = source.match(/^export \* from "(?<target>[^"]+)";$/m)?.groups?.target;
|
||||
const runtimeImportMatch = source.match(/import\("(?<target>\.[^"]+\.runtime\.js)"\)/m)?.groups
|
||||
?.target;
|
||||
if (runtimeImportMatch) {
|
||||
const resolvedTarget = path.join(path.dirname(absolutePath), runtimeImportMatch);
|
||||
const tsResolvedTarget = resolvedTarget.replace(/\.js$/u, ".ts");
|
||||
const runtimeSource = await fs.readFile(tsResolvedTarget, "utf8");
|
||||
return `${source}\n${runtimeSource}`;
|
||||
}
|
||||
if (!reexportMatch) {
|
||||
return source;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Command } from "commander";
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { Command } from "commander";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { OpenClawConfig, ConfigFileSnapshot } from "../config/types.openclaw.js";
|
||||
import type { UpdateRunResult } from "../infra/update-runner.js";
|
||||
|
||||
Reference in New Issue
Block a user