Skip to content

Commit

Permalink
perf: remove useless lib after isynclib (#1150)
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxianzhe authored Jan 4, 2024
1 parent f9c2c52 commit cb81a8c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
12 changes: 12 additions & 0 deletions scripts/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down
10 changes: 8 additions & 2 deletions scripts/synclib.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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,
});
Expand Down

0 comments on commit cb81a8c

Please sign in to comment.