代码拉取完成,页面将自动刷新
同步操作将从 theajack/cnchar 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
const {exec, Packages} = require('./tool');
const {plugins, allPackage, mainPackage, types, utils} = Packages;
// plugins 'main' 'npm' 'types' 可选
// npm run publish: 默认build 全部
// npm run publish main poly npm: build三个
async function main () {
const publish = 'npm publish ';
const publishPackage = `${publish}npm/packages/`;
const publishAll = `${publishPackage}cnchar-all`;
const publishTypes = `${publishPackage}cnchar-types`;
const publishMain = `${publishPackage}cnchar`;
let cmds = [];
let cmdConsole = [];
const packages = process.argv.slice(2);
packages.forEach(package => {
if (plugins.includes(package) || utils.includes(package)) {
cmds.push(`${publishPackage}${package}`);
cmdConsole.push(package);
} else if (package === mainPackage) {
cmds.push(publishMain);
cmdConsole.push(mainPackage);
} else if (package === allPackage) {
cmds.push(publishAll);
cmdConsole.push(allPackage);
} else if (package === types) {
cmds.push(publishTypes);
cmdConsole.push(types);
}
});
if (cmds.length === 0) {
cmds = [
publishTypes,
publishMain,
...plugins.map(plugin => `${publishPackage}${plugin}`),
publishAll,
...utils.map(util => `${publishPackage}${util}`)
];
cmdConsole = [
types,
mainPackage,
...plugins,
allPackage,
...utils
];
}
console.log(`Start Publish... [0/${cmds.length}]`);
const errorList = [];
for (let i = 0; i < cmds.length; i++) {
const {success, stderr} = await exec(cmds[i]); {
if (success) {
console.log(`${cmdConsole[i]} publish success. [${i + 1}/${cmds.length}]`);
} else {
console.log(stderr);
console.log(`${cmdConsole[i]} publish fail!. [${i + 1}/${cmds.length}]`);
errorList.push(cmdConsole[i]);
}
}
}
console.log('Finished!');
if (errorList.length > 0) {
console.log(`Fail Items: ${cmdConsole.toString()}`);
}
}
main();
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。