代码拉取完成,页面将自动刷新
同步操作将从 Gitee 极速下载/FabricJS 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
var cp = require('child_process');
var path = require('path');
var fs = require('fs');
// eslint-disable-next-line no-undef
var pkgPath = path.resolve(__dirname, './package.json');
var pkgText = fs.readFileSync(pkgPath); // get original pkg text to restore it later
var pkgObject = JSON.parse(pkgText); // parsed pkg to override its fields
var args = process.argv.slice(2).join(' '); // args will be passed to npm publish (like --dry-run)
var preRelease = process.env.PRE_RELEASE;
// allow publishing of pre-releases with beta tag
if (preRelease === 'true') {
console.log('Adding beta tag to NPM publish');
args = '--tag beta ' + args;
}
// override package.json with updated fields
fs.writeFileSync(
pkgPath,
JSON.stringify(Object.assign(pkgObject, {
optionalDependencies: {},
version: pkgObject.version + '-browser',
}), null, '\t')
);
console.log('npm publish ' + args);
// publish -browser version
cp.execSync('npm publish ' + args);
console.log('Browser package is published');
// restore the original package.json contents
fs.writeFileSync(pkgPath, pkgText);
// publish the main version (the package is published "above" the -browser version)
cp.execSync('npm publish ' + args);
console.log('Main package is published');
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。