fix(setup): preserve consent and startup target kind

This commit is contained in:
morluto
2026-07-12 08:51:35 +08:00
parent 62ede515b7
commit a67054f815
7 changed files with 69 additions and 4 deletions
+5 -1
View File
@@ -30,12 +30,16 @@ export const parseBinaryTarget = async (
input: string,
cwd = process.cwd(),
hostArchitecture: NodeJS.Architecture = process.arch,
targetKind?: BinaryTarget["kind"],
): Promise<Result<BinaryTarget, BinaryTargetError>> => {
const candidate = isAbsolute(input) ? input : resolve(cwd, input);
try {
await access(candidate, constants.R_OK);
const path = await realpath(candidate);
if (path.toLowerCase().endsWith(".hop"))
if (
targetKind === "database" ||
(targetKind === undefined && path.toLowerCase().endsWith(".hop"))
)
return ok({ path, kind: "database", format: "hopper", loaderArgs: [] });
const handle = await open(path, "r");
let bytes: Buffer;