mirror of https://github.com/openclaw/openclaw.git
17 lines
586 B
JavaScript
17 lines
586 B
JavaScript
import { readFileSync } from "node:fs";
|
|
import { resolve } from "node:path";
|
|
import { pathToFileURL } from "node:url";
|
|
import { writeTextFileIfChanged } from "./runtime-postbuild-shared.mjs";
|
|
|
|
export function copyPluginSdkRootAlias(params = {}) {
|
|
const cwd = params.cwd ?? process.cwd();
|
|
const source = resolve(cwd, "src/plugin-sdk/root-alias.cjs");
|
|
const target = resolve(cwd, "dist/plugin-sdk/root-alias.cjs");
|
|
|
|
writeTextFileIfChanged(target, readFileSync(source, "utf8"));
|
|
}
|
|
|
|
if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {
|
|
copyPluginSdkRootAlias();
|
|
}
|