MCPcopy
hub / github.com/zxlie/FeHelper / zipPackage

Function zipPackage

gulpfile.js:174–197  ·  view source on GitHub ↗
(outputRoot = 'output-chrome', cb)

Source from the content-addressed store, hash-verified

172
173// 清理冗余文件,并且打包成zip,发布到chrome webstore
174function zipPackage(outputRoot = 'output-chrome', cb) {
175 let pathOfMF = path.join(outputRoot, 'apps/manifest.json');
176 let manifest = JSON.parse(fs.readFileSync(pathOfMF, 'utf-8'));
177 manifest.name = manifest.name.replace('-Dev', '');
178 fs.writeFileSync(pathOfMF, JSON.stringify(manifest));
179 let pkgName = 'fehelper.zip';
180 if (outputRoot === 'output-firefox') {
181 pkgName = 'fehelper.xpi';
182 }
183 shell.exec(`cd ${outputRoot}/apps && rm -rf ../${pkgName} && zip -r ../${pkgName} ./* > /dev/null && cd ../../`);
184 let size = fs.statSync(`${outputRoot}/${pkgName}`).size;
185 size = pretty(size);
186 console.log('\n\n================================================================================');
187 console.log(' 当前版本:', manifest.version, '\t文件大小:', size);
188 if (outputRoot === 'output-chrome') {
189 console.log(' 去Chrome商店发布吧:https://chrome.google.com/webstore/devconsole');
190 } else if (outputRoot === 'output-edge') {
191 console.log(' 去Edge商店发布吧:https://partner.microsoft.com/zh-cn/dashboard/microsoftedge/overview');
192 } else if (outputRoot === 'output-firefox') {
193 console.log(' 去Firefox商店发布吧:https://addons.mozilla.org/zh-CN/developers/addon/fehelper-%E5%89%8D%E7%AB%AF%E5%8A%A9%E6%89%8B/edit');
194 }
195 console.log('================================================================================\n\n');
196 if (cb) cb();
197}
198
199// 设置静默标志
200function setSilentDetect(cb) {

Callers 3

zipChromeFunction · 0.85
zipEdgeFunction · 0.85
zipFirefoxFunction · 0.85

Calls 2

cbFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected