cordova-11/cmd/logo.js

31 lines
716 B
JavaScript
Raw Normal View History

2022-05-24 14:49:24 +08:00
/**
* @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();