diff --git a/scripts/clean.js b/scripts/clean.js index 555fa84a7..e89ccfa5b 100644 --- a/scripts/clean.js +++ b/scripts/clean.js @@ -15,6 +15,18 @@ exports.cleanIrisDir = async () => { logger.info(`clean:${destIrisSDKDir}`); }; +exports.cleanIrisUselessFile = async () => { + let uselessFileList = [ + `${destIrisSDKDir}/MAC/Release/AgoraRtcWrapperUnity.bundle`, + ]; + for (let file of uselessFileList) { + if (fs.existsSync(file)) { + await fs.remove(file); + logger.info(`clean:${file}`); + } + } +}; + exports.cleanBuildDir = async () => { await fs.remove(buildDir); logger.info(`clean:${buildDir}`); diff --git a/scripts/synclib.js b/scripts/synclib.js index 7f8d34fe6..50109b8b9 100644 --- a/scripts/synclib.js +++ b/scripts/synclib.js @@ -2,7 +2,11 @@ const path = require('path'); const download = require('download'); -const { destIrisSDKDir, cleanIrisDir } = require('./clean'); +const { + destIrisSDKDir, + cleanIrisDir, + cleanIrisUselessFile, +} = require('./clean'); const getConfig = require('./getConfig'); const logger = require('./logger'); const { getOS } = require('./util'); @@ -33,7 +37,9 @@ const syncLib = async (cb) => { const os = getOS(); await downloadSDK({ preHook: cleanIrisDir, - postHook: () => {}, + postHook: () => { + os === 'mac' && cleanIrisUselessFile(); + }, sdkURL: os === 'mac' ? iris_sdk_mac : iris_sdk_win, destDir: destIrisSDKDir, });