mirror of
https://github.com/LalleSX/4chan-XZ.git
synced 2026-01-30 09:48:12 +01:00
Deleted bloat
This commit is contained in:
parent
fbc329add3
commit
6bfa8a8516
@ -1,30 +0,0 @@
|
|||||||
var fs = require('fs');
|
|
||||||
var template = require('./template.js');
|
|
||||||
var coffee = require('coffeescript');
|
|
||||||
|
|
||||||
for (var name of process.argv.slice(2)) {
|
|
||||||
try {
|
|
||||||
var parts = name.match(/^tmp\/([^_]*)(?:_(.*))?-(.*)\.(.*)\.js$/);
|
|
||||||
var sourceName = `src/${parts[1]}/${parts[3]}.${parts[4]}`;
|
|
||||||
var script = fs.readFileSync(sourceName, 'utf8');
|
|
||||||
script = script.replace(/\r\n/g, '\n');
|
|
||||||
script = template(script, {type: parts[2]}, sourceName);
|
|
||||||
if (parts[4] === 'coffee') {
|
|
||||||
var definesVar = /^[$A-Z][$\w]*$/.test(parts[3]);
|
|
||||||
if (definesVar) {
|
|
||||||
script = `${script}\nreturn ${parts[3]};\n`;
|
|
||||||
}
|
|
||||||
script = coffee.compile(script);
|
|
||||||
if (definesVar) {
|
|
||||||
script = `${parts[3]} = ${script}`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
script += '\n';
|
|
||||||
fs.writeFileSync(name, script);
|
|
||||||
} catch (err) {
|
|
||||||
console.error(`Error processing ${name}`);
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
channel=$1
|
|
||||||
mkdir -p tmp-crx
|
|
||||||
cp -r "testbuilds/crx$channel" "tmp-crx/crx$channel"
|
|
||||||
touch -d "$(jq -r '.date' version.json)" "tmp-crx/crx$channel"/*
|
|
||||||
chromium --pack-extension="tmp-crx/crx$channel" --pack-extension-key="$(dirname "$PWD")/4chan-x.keys/4chan-X.pem"
|
|
||||||
mv "tmp-crx/crx$channel.crx" "testbuilds/4chan-X$channel.crx"
|
|
||||||
rm -r 'tmp-crx/'
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
var fs = require('fs');
|
|
||||||
var child_process = require('child_process');
|
|
||||||
var request = require('request');
|
|
||||||
|
|
||||||
var pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
|
||||||
var v = JSON.parse(child_process.execSync('git show stable:version.json').toString());
|
|
||||||
var secrets = JSON.parse(fs.readFileSync(`../${pkg.meta.path}.keys/chrome-store.json`, 'utf8'));
|
|
||||||
var refresh = JSON.parse(fs.readFileSync(`../${pkg.meta.path}.keys/refresh-token.json`, 'utf8'));
|
|
||||||
|
|
||||||
import('chrome-webstore-upload').then(chromeWebstoreUpload => {
|
|
||||||
var webStore = chromeWebstoreUpload.default({
|
|
||||||
extensionId: pkg.meta.chromeStoreID,
|
|
||||||
clientId: secrets.installed.client_id,
|
|
||||||
clientSecret: secrets.installed.client_secret,
|
|
||||||
refreshToken: refresh.refresh_token
|
|
||||||
});
|
|
||||||
|
|
||||||
request(`https://chrome.google.com/webstore/detail/${pkg.meta.chromeStoreID}`, function (error, response, body) {
|
|
||||||
|
|
||||||
if (body && body.indexOf(`<meta itemprop="version" content="${v.version}"/>`) > 0 && process.argv[2] !== 'force') {
|
|
||||||
console.log(`Version ${v.version} already uploaded.`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var myZipFile = fs.createReadStream(`dist/builds/${pkg.name}.zip`);
|
|
||||||
var token;
|
|
||||||
webStore.fetchToken().then(t => {
|
|
||||||
token = t;
|
|
||||||
return webStore.uploadExisting(myZipFile, token);
|
|
||||||
}).then(() =>
|
|
||||||
webStore.publish()
|
|
||||||
).catch(res => {
|
|
||||||
console.error(res);
|
|
||||||
process.exit(1);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
var fs = require('fs');
|
|
||||||
var JSZip = require('jszip');
|
|
||||||
|
|
||||||
var pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
|
||||||
var v = JSON.parse(fs.readFileSync('version.json', 'utf8'));
|
|
||||||
var channel = process.argv[2] || '';
|
|
||||||
|
|
||||||
var zip = new JSZip();
|
|
||||||
for (var file of ['script.js', 'eventPage.js', 'icon16.png', 'icon48.png', 'icon128.png', 'manifest.json']) {
|
|
||||||
zip.file(
|
|
||||||
file,
|
|
||||||
fs.readFileSync(`testbuilds/crx${channel}/${file}`),
|
|
||||||
{date: new Date(v.date)}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
zip.generateAsync({
|
|
||||||
type: 'nodebuffer',
|
|
||||||
compression: 'DEFLATE',
|
|
||||||
compressionOptions: {level: 9},
|
|
||||||
}).then(function(output) {
|
|
||||||
fs.writeFileSync(`testbuilds/${pkg.name}${channel}.crx.zip`, output);
|
|
||||||
}, function() {
|
|
||||||
process.exit(1);
|
|
||||||
});
|
|
||||||
Loading…
x
Reference in New Issue
Block a user