fix: use fs backend for host apply-patch
This commit is contained in:
@@ -1179,7 +1179,7 @@ export function formatApplyPatchV2BulkReplacementPayload(paths: Iterable<string>
|
||||
return { targets, payload: `${records.join("\n")}\n` };
|
||||
}
|
||||
|
||||
type RemoteV2Operation =
|
||||
export type ApplyPatchV2RemoteOperation =
|
||||
| "stat"
|
||||
| "read-b64-block"
|
||||
| "read-bulk-b64"
|
||||
@@ -1191,11 +1191,11 @@ type RemoteV2Operation =
|
||||
| "write-b64-commit"
|
||||
| "delete";
|
||||
|
||||
async function checkedRemoteV2(executor: ApplyPatchV2Executor, operation: RemoteV2Operation, args: string[], input?: string): Promise<{ stdout: string }> {
|
||||
async function checkedRemoteV2(executor: ApplyPatchV2Executor, operation: ApplyPatchV2RemoteOperation, args: string[], input?: string): Promise<{ stdout: string }> {
|
||||
if (!executor.run) {
|
||||
throw new ApplyPatchV2Error("remote apply-patch v2 executor does not provide a command runner", { operation, args });
|
||||
}
|
||||
const result = await executor.run(remoteV2Script(operation, args), input);
|
||||
const result = await executor.run(applyPatchV2RemoteCommand(operation, args), input);
|
||||
if (result.exitCode === 0) return result;
|
||||
throw new ApplyPatchV2Error("remote apply-patch v2 operation failed", {
|
||||
operation,
|
||||
@@ -1206,7 +1206,7 @@ async function checkedRemoteV2(executor: ApplyPatchV2Executor, operation: Remote
|
||||
});
|
||||
}
|
||||
|
||||
function remoteV2Script(operation: RemoteV2Operation, args: string[]): string[] {
|
||||
export function applyPatchV2RemoteCommand(operation: ApplyPatchV2RemoteOperation, args: string[]): string[] {
|
||||
const script = [
|
||||
"set -eu",
|
||||
"sha256_file() {",
|
||||
|
||||
Reference in New Issue
Block a user