Lint tools/*.js

This commit is contained in:
ccd0 2016-04-12 00:13:41 -07:00
parent 5445327302
commit 73bd06389d
5 changed files with 22 additions and 17 deletions

17
.gitignore vendored
View File

@ -2,12 +2,11 @@ node_modules/
*~
*.db
*.DS_Store
tmp/
testbuilds/
test.html
captchas.html
install.json
Gruntfile.js
.jshintrc
.tests_enabled
.events
/tmp/
/testbuilds/
/test.html
/captchas.html
/install.json
/.jshintrc
/.tests_enabled
/.events

6
tools/.jshintrc Normal file
View File

@ -0,0 +1,6 @@
{
"esnext": true,
"undef": true,
"unused": true,
"node": true
}

View File

@ -1,8 +1,8 @@
var fs = require('fs-extra');
var installMap = fs.readJsonSync('install.json');
for (src in installMap) {
for (dest of installMap[src]) {
for (var src in installMap) {
for (var dest of installMap[src]) {
fs.copySync(src, dest);
}
}

View File

@ -1,14 +1,14 @@
fs = require('fs');
crx = require('crx');
var fs = require('fs');
var crx = require('crx');
var pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
var channel = process.argv[2] || '';
var privateKey = fs.readFileSync(`../${pkg.meta.path}.keys/${pkg.name}.pem`)
var privateKey = fs.readFileSync(`../${pkg.meta.path}.keys/${pkg.name}.pem`);
var archive = fs.readFileSync(`testbuilds/${pkg.name}${channel}.crx.zip`);
var extension = new crx({privateKey, loaded: true});
extension.pack(archive).then((data) =>
fs.writeFileSync(`testbuilds/${pkg.name}${channel}.crx`, data)
).catch(function(err) {
).catch(function() {
process.exit(1);
});

View File

@ -6,14 +6,14 @@ var v = JSON.parse(fs.readFileSync('version.json', 'utf8'));
var channel = process.argv[2] || '';
var zip = new JSZip();
for (file of ['eventPage.js', 'icon128.png', 'icon16.png', 'icon48.png', 'manifest.json', 'script.js']) {
for (var file of ['eventPage.js', 'icon128.png', 'icon16.png', 'icon48.png', 'manifest.json', 'script.js']) {
zip.file(
file,
fs.readFileSync(`testbuilds/crx${channel}/${file}`),
{date: new Date(v.date)}
);
}
output = zip.generate({
var output = zip.generate({
type: 'nodebuffer',
compression: 'DEFLATE',
compressionOptions: {level: 9},