fix: share native cicd script loader
This commit is contained in:
@@ -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 [
|
||||
|
||||
Reference in New Issue
Block a user