diff --git a/desktop/main-app/scripts/download-agora-addon/patch-download.js b/desktop/main-app/scripts/download-agora-addon/patch-download.js index b94b7dc017f..5759bd94700 100644 --- a/desktop/main-app/scripts/download-agora-addon/patch-download.js +++ b/desktop/main-app/scripts/download-agora-addon/patch-download.js @@ -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); } @@ -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", diff --git a/desktop/main-app/scripts/pack/index.js b/desktop/main-app/scripts/pack/index.js index 5ee7c8bbe3c..dc50ef60edd 100644 --- a/desktop/main-app/scripts/pack/index.js +++ b/desktop/main-app/scripts/pack/index.js @@ -118,10 +118,6 @@ const buildElectron = async () => { }; (async () => { - if (buildType === getAgoraReleaseType()) { - return buildElectron(buildType); - } - downloadAddon(buildType); await buildElectron(buildType);