Skip to content

Commit

Permalink
fix(electron): cross pack failed (#1478)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackHole1 authored Apr 18, 2022
1 parent 14c4cd3 commit 2ea4e47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ const path = require("path");
const fs = require("fs-extra");
const { agoraElectronSdkPath } = require("../constant");
const download = require(path.join(agoraElectronSdkPath, "scripts", "download"));
const nativeExtPath = path.join(agoraElectronSdkPath, "build", "Release", "agora_node_ext.node");
const { getAgoraReleaseType } = require("../pack/utils");

if (fs.existsSync(nativeExtPath) && !("FORCE_REBUILD_AGORA_NODE_EXT" in process.env)) {
const platform = process.argv[2];

if (platform === getAgoraReleaseType()) {
// Don't download again.
process.exit(0);
}
Expand All @@ -14,8 +16,6 @@ const agoraVersion = require(path.join(agoraElectronSdkPath, "package.json")).ve

fs.removeSync(path.join(agoraElectronSdkPath, "build"));

const platform = process.argv[2];

download({
electronVersion,
platform: platform === "win" ? "win32" : "darwin",
Expand Down
4 changes: 0 additions & 4 deletions desktop/main-app/scripts/pack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,6 @@ const buildElectron = async () => {
};

(async () => {
if (buildType === getAgoraReleaseType()) {
return buildElectron(buildType);
}

downloadAddon(buildType);

await buildElectron(buildType);
Expand Down

0 comments on commit 2ea4e47

Please sign in to comment.