element-desktop/hak/keytar/build.ts

27 lines
777 B
TypeScript
Raw Normal View History

2020-05-28 21:07:39 +02:00
/*
2024-09-06 18:56:18 +02:00
Copyright 2024 New Vector Ltd.
2020-05-28 21:07:39 +02:00
Copyright 2020 The Matrix.org Foundation C.I.C.
2024-09-06 18:56:18 +02:00
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
2020-05-28 21:07:39 +02:00
*/
import path from "node:path";
2020-05-28 21:07:39 +02:00
import type HakEnv from "../../scripts/hak/hakEnv.js";
import type { DependencyInfo } from "../../scripts/hak/dep.js";
2020-05-28 21:07:39 +02:00
export default async function buildKeytar(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
2020-05-28 21:07:39 +02:00
const env = hakEnv.makeGypEnv();
console.log("Running yarn with env", env);
await hakEnv.spawn(
path.join(moduleInfo.nodeModuleBinDir, "node-gyp"),
["rebuild", "--arch", hakEnv.getTargetArch()],
{
cwd: moduleInfo.moduleBuildDir,
env,
},
);
2020-05-28 21:07:39 +02:00
}