vue-office/core/script/bak-vue.js
2023-04-21 12:59:52 +08:00

16 lines
538 B
JavaScript

const fs = require('fs');
const path = require('path');
const spawnSync = require('child_process').spawnSync;
const type = process.argv[2];
const vuePath = path.resolve(__dirname, '../node_modules/vue');
const vueBakPath = path.resolve(__dirname, '../node_modules/vue-bak');
if(type === 'bak'){
if (!fs.existsSync(vueBakPath) && fs.existsSync(vuePath)) {
spawnSync('mv',[vuePath, vueBakPath]);
}
}else{
if (!fs.existsSync(vuePath) && fs.existsSync(vueBakPath)) {
spawnSync('mv',[vueBakPath, vuePath]);
}
}