/** * @author Taoya * @date 2022/5/23 * @Description: 一键替换Logo */ const fs = require('fs') const { resolve } = require('path') const exec = require('child_process').execSync let path = require('path'); const chalk = require('chalk'); const logger = require('./utils/logger.js'); function icopy(file1,file2) { exec(`cp ${file1} ${file2}`) } function main() { let baseDir = resolve('./') let logoFile = baseDir+'/logo.png' logger.log('info', "一键替换Logo") logger.log('info', 'BaseDir: '+ baseDir); if(fs.existsSync(logoFile)){ icopy(logoFile, './res/icon/android/logo.png') }else{ logger.log('info', '文件不存在'); return ; } } main();