fix: share native cicd script loader

This commit is contained in:
Codex
2026-07-03 15:25:45 +00:00
parent 244f10d154
commit e20739a0f2
2 changed files with 4 additions and 8 deletions
+2 -6
View File
@@ -35,7 +35,7 @@ export function readNativeObjectBundle(registry: BranchFollowerRegistry, followe
"tmpdir=$(mktemp -d)",
"cleanup() { rm -rf \"$tmpdir\"; }",
"trap cleanup EXIT INT TERM",
nativeBundleScriptLoadShell(),
nativeCicdScriptLoadShell(NATIVE_BUNDLE_SCRIPT_NAMES),
`REPO_PATH=${shQuote(source.repoPath)}`,
`SOURCE_BRANCH=${shQuote(follower.source.branch)}`,
`REPOSITORY=${shQuote(follower.source.repository)}`,
@@ -80,11 +80,7 @@ export function readNativeObjectBundle(registry: BranchFollowerRegistry, followe
};
}
function nativeBundleScriptLoadShell(): string {
return nativeScriptLoadShell(NATIVE_BUNDLE_SCRIPT_NAMES);
}
function nativeScriptLoadShell(names: readonly string[]): string {
export function nativeCicdScriptLoadShell(names: readonly string[]): string {
return names.map((name) => {
const encoded = Buffer.from(readFileSync(rootPath("scripts/native/cicd", name), "utf8"), "utf8").toString("base64");
return [