mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-27 00:52:05 +00:00
Gateway: sync runtime post-build artifacts
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
#!/usr/bin/env node
|
||||
import { readFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
import { pathToFileURL } from "node:url";
|
||||
import { writeTextFileIfChanged } from "./runtime-postbuild-shared.mjs";
|
||||
|
||||
import { copyFileSync, mkdirSync } from "node:fs";
|
||||
import { dirname, resolve } from "node:path";
|
||||
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");
|
||||
|
||||
const source = resolve("src/plugin-sdk/root-alias.cjs");
|
||||
const target = resolve("dist/plugin-sdk/root-alias.cjs");
|
||||
writeTextFileIfChanged(target, readFileSync(source, "utf8"));
|
||||
}
|
||||
|
||||
mkdirSync(dirname(target), { recursive: true });
|
||||
copyFileSync(source, target);
|
||||
if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {
|
||||
copyPluginSdkRootAlias();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user