@cloudroom/electron-meeting-sdk
Version:
基于C++,一款含UI的在线会议快速集成插件
40 lines (34 loc) • 1.09 kB
JavaScript
const downloadStatic = require('@cloudroom/load-static');
const path = require('path');
const { version } = require('./package.json');
const fs = require('fs')
let platform = process.env.npm_config_platform || process.platform;
let arch = process.env.npm_config_arch || process.arch;
if (platform === 'win32') {
platform = 'win'
} else if (platform === 'darwin') {
platform = 'mac'
}
if (arch === 'ia32') {
arch = 'x86'
} else if (arch === 'x64') {
arch = 'x86_64'
} else if (arch === 'arm64') {
arch = 'aarch64'
} else if (arch === 'arm') {
arch = 'armv7l'
}
['win', 'mac', 'linux'].forEach(item => {
if (fs.existsSync(path.resolve(__dirname, `./${item}`))) {
fs.rmSync(path.resolve(__dirname, `./${item}`), { recursive: true });
}
})
const bigVersion = version.split('.').slice(0, 2).join('.');
const url = `https://cdn1.cloudroom.com/cdn_static/electron_meetingSDK_node/${bigVersion}/${platform}/${arch}.zip`;
downloadStatic(
url,
{
dir: path.resolve(__dirname, `./${platform}/${arch}/`),
needCompress: true
}
)